luci-base: cbi.js: drop CustomEvent polyfill
authorJo-Philipp Wich <jo@mein.io>
Fri, 15 Mar 2024 12:37:23 +0000 (13:37 +0100)
committerJo-Philipp Wich <jo@mein.io>
Fri, 15 Mar 2024 12:37:23 +0000 (13:37 +0100)
All supported browsers natively support this functionality since
quite a while already.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
modules/luci-base/htdocs/luci-static/resources/cbi.js

index 38687a1cef69e52fbb293e1faa75051f4f11dec7..d7b462c367e54106c58a4f48af5e016095210ea7 100644 (file)
@@ -733,18 +733,6 @@ function matchesElem(node, selector) { return L.dom.matches(node, selector) }
 function findParent(node, selector) { return L.dom.parent(node, selector) }
 function E() { return L.dom.create.apply(L.dom, arguments) }
 
-if (typeof(window.CustomEvent) !== 'function') {
-       function CustomEvent(event, params) {
-               params = params || { bubbles: false, cancelable: false, detail: undefined };
-               var evt = document.createEvent('CustomEvent');
-                   evt.initCustomEvent( event, params.bubbles, params.cancelable, params.detail );
-               return evt;
-       }
-
-       CustomEvent.prototype = window.Event.prototype;
-       window.CustomEvent = CustomEvent;
-}
-
 function cbi_dropdown_init(sb) {
        if (sb && L.dom.findClassInstance(sb) instanceof L.ui.Dropdown)
                return;