mirror of
https://github.com/Choices-js/Choices.git
synced 2024-06-10 09:52:18 +02:00
Use dep for event polyfill
This commit is contained in:
parent
1608d815e9
commit
25309c91fc
|
@ -68,10 +68,11 @@
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"classnames": "^2.2.5",
|
"classnames": "^2.2.5",
|
||||||
|
"core-js": "^2.5.6",
|
||||||
|
"custom-event-polyfill": "^0.3.0",
|
||||||
"fuse.js": "^3.1.0",
|
"fuse.js": "^3.1.0",
|
||||||
"opn": "^5.1.0",
|
"opn": "^5.1.0",
|
||||||
"redux": "^3.3.1",
|
"redux": "^3.3.1"
|
||||||
"core-js": "^2.5.6"
|
|
||||||
},
|
},
|
||||||
"npmName": "choices.js",
|
"npmName": "choices.js",
|
||||||
"npmFileMap": [
|
"npmFileMap": [
|
||||||
|
|
|
@ -1,18 +1,2 @@
|
||||||
import 'core-js/fn/array/from';
|
import 'core-js/fn/array/from';
|
||||||
import 'core-js/fn/array/find';
|
import 'custom-event-polyfill';
|
||||||
|
|
||||||
(function CustomEventPolyfill() {
|
|
||||||
if (typeof window.CustomEvent === 'function') {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
function CustomEvent (event, params = { bubbles: false, cancelable: false, detail: undefined }) {
|
|
||||||
const evt = document.createEvent('CustomEvent');
|
|
||||||
evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);
|
|
||||||
return evt;
|
|
||||||
}
|
|
||||||
|
|
||||||
CustomEvent.prototype = window.Event.prototype;
|
|
||||||
|
|
||||||
window.CustomEvent = CustomEvent;
|
|
||||||
}());
|
|
||||||
|
|
Loading…
Reference in a new issue