Browse Source

KERNEL-14316 chore: 代码调整

es6
Treecat 2 years ago
parent
commit
70ce2bf293
  1. 10
      packages/fineui/src/polyfill/event.js

10
packages/fineui/src/polyfill/event.js

@ -1,9 +1,9 @@
(function () { const isIE = () => typeof window.CustomEvent !== "function";
if (typeof window.CustomEvent === "function") return false; // If not IE
function CustomEvent (event, params) { if (isIE()) {
function CustomEvent(event, params) {
params = params || { bubbles: false, cancelable: false, detail: undefined }; params = params || { bubbles: false, cancelable: false, detail: undefined };
var evt = document.createEvent("CustomEvent"); const evt = document.createEvent("CustomEvent");
evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail); evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);
return evt; return evt;
@ -12,4 +12,4 @@
CustomEvent.prototype = window.Event.prototype; CustomEvent.prototype = window.Event.prototype;
window.CustomEvent = CustomEvent; window.CustomEvent = CustomEvent;
}()); }

Loading…
Cancel
Save