Browse Source

Fix `Esc` interrupt when button not visible

catboxanon 1 năm trước cách đây
mục cha
commit
46988af636
1 tập tin đã thay đổi với 4 bổ sung2 xóa
  1. 4 2
      script.js

+ 4 - 2
script.js

@@ -167,8 +167,10 @@ document.addEventListener('keydown', function(e) {
         const lightboxModal = document.querySelector('#lightboxModal');
         if (!globalPopup || globalPopup.style.display === 'none') {
             if (document.activeElement === lightboxModal) return;
-            interruptButton.click();
-            e.preventDefault();
+            if (interruptButton.style.display !== 'none') {
+                interruptButton.click();
+                e.preventDefault();
+            }
         }
     }
 });