mirror of
https://github.com/Choices-js/Choices.git
synced 2024-05-02 22:03:11 +02:00
Use dep for event polyfill
This commit is contained in:
parent
1608d815e9
commit
25309c91fc
|
@ -68,10 +68,11 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"classnames": "^2.2.5",
|
||||
"core-js": "^2.5.6",
|
||||
"custom-event-polyfill": "^0.3.0",
|
||||
"fuse.js": "^3.1.0",
|
||||
"opn": "^5.1.0",
|
||||
"redux": "^3.3.1",
|
||||
"core-js": "^2.5.6"
|
||||
"redux": "^3.3.1"
|
||||
},
|
||||
"npmName": "choices.js",
|
||||
"npmFileMap": [
|
||||
|
|
|
@ -1,18 +1,2 @@
|
|||
import 'core-js/fn/array/from';
|
||||
import 'core-js/fn/array/find';
|
||||
|
||||
(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;
|
||||
}());
|
||||
import 'custom-event-polyfill';
|
||||
|
|
Loading…
Reference in a new issue