mirror of
https://github.com/PitPik/colorPicker.git
synced 2025-09-08 16:52:36 -06:00
Fixes loading in header and right mouse button
This commit is contained in:
parent
91b3f2d618
commit
557f47285a
6
color.all.min.js
vendored
6
color.all.min.js
vendored
File diff suppressed because one or more lines are too long
@ -13,8 +13,8 @@
|
|||||||
// _bgsPng: ..., // some more icon sprite images
|
// _bgsPng: ..., // some more icon sprite images
|
||||||
// }
|
// }
|
||||||
_devMode = !_data, // if no _data we assume that colorPicker.data.js is missing (for development)
|
_devMode = !_data, // if no _data we assume that colorPicker.data.js is missing (for development)
|
||||||
_isIE = document.createStyleSheet !== undefined && document.getElementById || !!window.MSInputMethodContext,
|
_isIE = false,
|
||||||
_doesOpacity = typeof document.body.style.opacity !== 'undefined',
|
_doesOpacity = false,
|
||||||
// _isIE8 = _isIE && document.querySelectorAll,
|
// _isIE8 = _isIE && document.querySelectorAll,
|
||||||
|
|
||||||
_valueRanges = {}, // will be assigned in initInstance() by Colors instance
|
_valueRanges = {}, // will be assigned in initInstance() by Colors instance
|
||||||
@ -213,6 +213,8 @@
|
|||||||
for (var option in options) { // deep copy ??
|
for (var option in options) { // deep copy ??
|
||||||
THIS.options[option] = options[option];
|
THIS.options[option] = options[option];
|
||||||
}
|
}
|
||||||
|
_isIE = document.createStyleSheet !== undefined && document.getElementById || !!window.MSInputMethodContext;
|
||||||
|
_doesOpacity = typeof document.body.style.opacity !== 'undefined';
|
||||||
_colorInstance = new Colors(THIS.options);
|
_colorInstance = new Colors(THIS.options);
|
||||||
// We transfer the responsibility to the instance of Color (to save space and memory)
|
// We transfer the responsibility to the instance of Color (to save space and memory)
|
||||||
delete THIS.options;
|
delete THIS.options;
|
||||||
@ -438,7 +440,8 @@
|
|||||||
onOffEvent(_nodes.colorPicker, 'mousedown', function(e) {
|
onOffEvent(_nodes.colorPicker, 'mousedown', function(e) {
|
||||||
var event = e || window.event,
|
var event = e || window.event,
|
||||||
page = getPageXY(event),
|
page = getPageXY(event),
|
||||||
target = event.target || event.srcElement,
|
target = (event.button || event.which) < 2 ?
|
||||||
|
(event.target || event.srcElement) : {},
|
||||||
className = target.className;
|
className = target.className;
|
||||||
|
|
||||||
focusInstance(THIS);
|
focusInstance(THIS);
|
||||||
|
File diff suppressed because one or more lines are too long
@ -28,8 +28,8 @@
|
|||||||
grey = {r: 0.298954, g: 0.586434, b: 0.114612}, // CIE-XYZ 1931
|
grey = {r: 0.298954, g: 0.586434, b: 0.114612}, // CIE-XYZ 1931
|
||||||
luminance = {r: 0.2126, g: 0.7152, b: 0.0722}, // W3C 2.0
|
luminance = {r: 0.2126, g: 0.7152, b: 0.0722}, // W3C 2.0
|
||||||
|
|
||||||
_math = Math,
|
_math = window.Math,
|
||||||
_parseint = parseInt,
|
_parseint = window.parseInt,
|
||||||
|
|
||||||
Colors = window.Colors = function(options) {
|
Colors = window.Colors = function(options) {
|
||||||
this.colors = {RND: {}};
|
this.colors = {RND: {}};
|
||||||
@ -167,7 +167,8 @@
|
|||||||
alpha = alpha !== undefined ? alpha : color.alpha;
|
alpha = alpha !== undefined ? alpha : color.alpha;
|
||||||
} else if (color) {
|
} else if (color) {
|
||||||
for (var n in color) {
|
for (var n in color) {
|
||||||
colors[type][n] = limitValue(color[n] / _valueRanges[type][n][1], 0 , 1);
|
colors[type][n] = type === 'Lab' ? color[n] :
|
||||||
|
limitValue(color[n] / _valueRanges[type][n][1], 0 , 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (alpha !== undefined) {
|
if (alpha !== undefined) {
|
||||||
|
2
index.js
2
index.js
@ -163,7 +163,7 @@
|
|||||||
type = child.id.substr(0, len),
|
type = child.id.substr(0, len),
|
||||||
mode = child.id.charAt(len).toLowerCase();
|
mode = child.id.charAt(len).toLowerCase();
|
||||||
|
|
||||||
if (child.id) child.children[0].style.width = (color.RND[type][mode] / max[type][mode] * 100) + '%';
|
child.children[0].style.width = (color.RND[type][mode] / max[type][mode] * 100) + '%';
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user