mirror of
https://github.com/PitPik/colorPicker.git
synced 2025-09-24 16:40:57 -06:00
Update jsColor.js
use getBoundingClientRect instead of element offset to account for absolute positioned elements.
This commit is contained in:
parent
720786e309
commit
9b004c41f3
@ -98,7 +98,8 @@
|
||||
var onOff = off ? 'removeEventListener' : 'addEventListener',
|
||||
focusListener = function(e) {
|
||||
var input = this,
|
||||
position = {left: input.offsetLeft, top: input.offsetTop},
|
||||
inputRect = input.getBoundingClientRect(),
|
||||
position = {left: inputRect.left, top: inputRect.top},
|
||||
index = multiple ? Array.prototype.indexOf.call(elms, this) : 0,
|
||||
colorPicker = colorPickers[index] ||
|
||||
(colorPickers[index] = createInstance(this, config)),
|
||||
@ -226,4 +227,4 @@
|
||||
(options.secure ? '; secure' : '');
|
||||
}
|
||||
};
|
||||
})(this);
|
||||
})(this);
|
||||
|
Loading…
x
Reference in New Issue
Block a user