Merge pull request #381 from glowing-bear/fix-esc

Properly iterate over modals in ESC key handler
This commit is contained in:
David Cormier 2014-07-25 16:52:09 -04:00
commit 7ee237cf3a

View file

@ -1535,7 +1535,7 @@ weechat.directive('inputBar', function() {
// Check if a modal is visible. If so, close it instead of disconnecting // Check if a modal is visible. If so, close it instead of disconnecting
var modals = document.querySelectorAll('.gb-modal'); 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') { if (modals[modalId].getAttribute('data-state') === 'visible') {
modals[modalId].setAttribute('data-state', 'hidden'); modals[modalId].setAttribute('data-state', 'hidden');
return true; return true;