From bea1cf692366a118288d2b650140b4fc07d239e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lorenz=20H=C3=BCbschle-Schneider?= Date: Wed, 23 Jul 2014 19:33:39 +0100 Subject: [PATCH] Properly iterate over modals in ESC key handler the old way included attributes like 'length' and would raise an exception, causing disconnection via double-esc to fail --- js/glowingbear.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/glowingbear.js b/js/glowingbear.js index 16968cd..c36a1bd 100644 --- a/js/glowingbear.js +++ b/js/glowingbear.js @@ -1533,7 +1533,7 @@ weechat.directive('inputBar', function() { // Check if a modal is visible. If so, close it instead of disconnecting var modals = document.querySelectorAll('.gb-modal'); - for (var modalId in modals) { + for (var modalId = 0; modalId < modals.length; modalId++) { if (modals[modalId].getAttribute('data-state') === 'visible') { modals[modalId].setAttribute('data-state', 'hidden'); return true;