Browse Source

added css prepend

master
peterd 2 years ago
parent
commit
999178d089
4 changed files with 10 additions and 7 deletions
  1. 2
    1
      README.md
  2. 5
    3
      jqColorPicker.js
  3. 1
    1
      jqColorPicker.js.map
  4. 2
    2
      jqColorPicker.min.js

+ 2
- 1
README.md View File

@@ -106,7 +106,8 @@ $('.color').colorPicker({
106 106
     light: '#DDD' // default font color if background is dark
107 107
     preventFocus: false // prevents default on focus of input fields (e.g. no keyboard on mobile)
108 108
     body: document.body // the element where the events are attached to (touchstart, mousedown, pointerdown, focus, click, change),
109
-    forceAlpha: // force printing alpha channel (undefined = auto; false = never print alpha)
109
+    forceAlpha: // force printing alpha channel (undefined = auto; false = never print alpha),
110
+    cssPrepend: // makes add CSS being added to the beginning of the <head> instead of to the end
110 111
 });
111 112
 ```
112 113
 See the following section or the demos on how the callbacks work and what you can do with them...

+ 5
- 3
jqColorPicker.js View File

@@ -123,8 +123,9 @@
123 123
     }
124 124
 
125 125
     function build() {
126
-        $('head').append('<style type="text/css" id="tinyColorPickerStyles">' +
127
-            (_options.css || _css) + (_options.cssAddon || '') + '</style>');
126
+        $('head')[_options.cssPrepend ? 'prepend' : 'append']
127
+            ('<style type="text/css" id="tinyColorPickerStyles">' +
128
+                (_options.css || _css) + (_options.cssAddon || '') + '</style>');
128 129
 
129 130
         return $(_html).css({'margin': _options.margin})
130 131
             .appendTo('body')
@@ -281,7 +282,8 @@
281 282
             scrollResize: true,
282 283
             gap: 4,
283 284
             dark: '#222',
284
-            light: '#DDD'
285
+            light: '#DDD',
286
+            // cssPrepend: true,
285 287
             // forceAlpha: undefined,
286 288
             // css: '',
287 289
             // cssAddon: '',

+ 1
- 1
jqColorPicker.js.map
File diff suppressed because it is too large
View File


+ 2
- 2
jqColorPicker.min.js
File diff suppressed because it is too large
View File


Loading…
Cancel
Save