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
This commit is contained in:
Lorenz Hübschle-Schneider 2014-07-23 19:33:39 +01:00
parent 013cc03380
commit bea1cf6923

View file

@ -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;