Skip to content

Commit

Permalink
luci-base: cbi.js: drop CustomEvent polyfill
Browse files Browse the repository at this point in the history
All supported browsers natively support this functionality since
quite a while already.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
  • Loading branch information
jow- committed Mar 15, 2024
1 parent 61cef9b commit 3edbecf
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions modules/luci-base/htdocs/luci-static/resources/cbi.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 3edbecf

Please sign in to comment.