diff --git a/js/image_filter.js b/js/image_filter.js index f2f0bae..c347c6c 100644 --- a/js/image_filter.js +++ b/js/image_filter.js @@ -13,6 +13,12 @@ app.registerExtension({ type: "boolean", defaultValue: true }, + { + id: "ImageFilter.ReshowWindow", + name: "Pressing '!' reshows the window", + type: "boolean", + defaultValue: true + }, ], setup() { create('link', null, document.getElementsByTagName('HEAD')[0], diff --git a/js/popup.js b/js/popup.js index 6fac723..6a3df58 100644 --- a/js/popup.js +++ b/js/popup.js @@ -237,12 +237,13 @@ class Popup extends HTMLSpanElement { } on_keypress(e) { - if (e.key=='!') { + if (e.key=='!' && app.ui.settings.getSettingValue("ImageFilter.ReshowWindow") && !this.contains(document.activeElement)) { this.reshow_window() return } - if (!this.active) return - if (this.doing_text) return + + if (this.doing_text || !this.active) return + if (e.key=='x') { e.stopPropagation() e.preventDefault()