From: XhmikosR Date: Wed, 29 Mar 2023 08:00:31 +0000 (+0300) Subject: Modal: drop loop (#38368) X-Git-Tag: v5.3.0-alpha3~6 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=7a7fc1ad34d61a22b6cded76de1dc2e1acfe6fc1;p=thirdparty%2Fbootstrap.git Modal: drop loop (#38368) We only have two elements to iterate over so it doesn't make a lot of sense to use a loop here --- diff --git a/js/src/modal.js b/js/src/modal.js index 454d46aea2..c4c4102042 100644 --- a/js/src/modal.js +++ b/js/src/modal.js @@ -139,12 +139,12 @@ class Modal extends BaseComponent { } dispose() { - for (const htmlElement of [window, this._dialog]) { - EventHandler.off(htmlElement, EVENT_KEY) - } + EventHandler.off(window, EVENT_KEY) + EventHandler.off(this._dialog, EVENT_KEY) this._backdrop.dispose() this._focustrap.deactivate() + super.dispose() }