mirror of
https://github.com/PitPik/colorPicker.git
synced 2025-09-24 16:40:57 -06:00
IE8- compatibility in doEventListeners
For IE8- : use attachEvent/detachEvent instead of addEventListener/removeEventListener
This commit is contained in:
parent
05592ce362
commit
c957428e69
@ -95,7 +95,8 @@
|
|||||||
return new initConfig.klass(initConfig);
|
return new initConfig.klass(initConfig);
|
||||||
},
|
},
|
||||||
doEventListeners = function(elm, multiple, off) {
|
doEventListeners = function(elm, multiple, off) {
|
||||||
var onOff = off ? 'removeEventListener' : 'addEventListener',
|
var ie8 = !document.addEventListener,
|
||||||
|
onOff = off ? (ie8?'detachEvent':'removeEventListener') : (ie8?'attachEvent':'addEventListener'),
|
||||||
focusListener = function(e) {
|
focusListener = function(e) {
|
||||||
var input = this,
|
var input = this,
|
||||||
position = window.ColorPicker.getOrigin(input),
|
position = window.ColorPicker.getOrigin(input),
|
||||||
@ -233,4 +234,4 @@
|
|||||||
(options.secure ? '; secure' : '');
|
(options.secure ? '; secure' : '');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
})(this);
|
})(this);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user