2
0
mirror of https://github.com/PitPik/tinyColorPicker synced 2025-08-13 04:02:44 -06:00

added css prepend

This commit is contained in:
peterd 2016-08-30 15:31:29 +02:00
parent 44ffe523b6
commit 999178d089
4 changed files with 10 additions and 7 deletions

View File

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

View File

@ -123,7 +123,8 @@
} }
function build() { function build() {
$('head').append('<style type="text/css" id="tinyColorPickerStyles">' + $('head')[_options.cssPrepend ? 'prepend' : 'append']
('<style type="text/css" id="tinyColorPickerStyles">' +
(_options.css || _css) + (_options.cssAddon || '') + '</style>'); (_options.css || _css) + (_options.cssAddon || '') + '</style>');
return $(_html).css({'margin': _options.margin}) return $(_html).css({'margin': _options.margin})
@ -281,7 +282,8 @@
scrollResize: true, scrollResize: true,
gap: 4, gap: 4,
dark: '#222', dark: '#222',
light: '#DDD' light: '#DDD',
// cssPrepend: true,
// forceAlpha: undefined, // forceAlpha: undefined,
// css: '', // css: '',
// cssAddon: '', // cssAddon: '',

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long