From: Andrew Dolgov Date: Sun, 21 Nov 2010 10:52:01 +0000 (+0300) Subject: rework hotkey blocking on INPUT elements X-Git-Tag: 1.5.0~87 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=4aeafea2837795bdda930bfbe90d26f943e6fcce;p=tt-rss.git rework hotkey blocking on INPUT elements --- diff --git a/feedlist.js b/feedlist.js index 05a16d86..a39748f1 100644 --- a/feedlist.js +++ b/feedlist.js @@ -82,7 +82,6 @@ function viewfeed(feed, subop, is_cat, offset) { _infscroll_request_sent = timestamp; } - enableHotkeys(); hideAuxDlg(); closeInfoBox(); diff --git a/functions.js b/functions.js index 935740b9..8e02b793 100644 --- a/functions.js +++ b/functions.js @@ -1,4 +1,3 @@ -var hotkeys_enabled = true; var notify_silent = false; var loading_progress = 0; var sanity_check_done = false; @@ -84,15 +83,6 @@ function format_exception_error(location, e) { return msg; } - -function disableHotkeys() { - hotkeys_enabled = false; -} - -function enableHotkeys() { - hotkeys_enabled = true; -} - function param_escape(arg) { if (typeof encodeURIComponent != 'undefined') return encodeURIComponent(arg); @@ -398,8 +388,6 @@ function closeErrorBox() { if (Element.visible("errorBoxShadow")) { Element.hide("dialog_overlay"); Element.hide("errorBoxShadow"); - - enableHotkeys(); } return false; @@ -407,8 +395,6 @@ function closeErrorBox() { function closeInfoBox(cleanup) { try { - enableHotkeys(); - dialog = dijit.byId("infoBox"); if (dialog) dialog.hide(); diff --git a/prefs.js b/prefs.js index 3a36c287..4851611a 100644 --- a/prefs.js +++ b/prefs.js @@ -964,8 +964,7 @@ function validatePrefsReset() { function pref_hotkey_handler(e) { try { - - if (dijit.getEnclosingWidget(e.target)) return; + if (e.target.nodeName == "INPUT") return; var keycode; var shift_key = false; @@ -994,17 +993,6 @@ function pref_hotkey_handler(e) { closeInfoBox(); } - var dialog = dijit.byId("infoBox"); - var dialog_visible = false; - - if (dialog) - dialog_visible = Element.visible(dialog.domNode); - - if (dialog_visible || !hotkeys_enabled) { - console.log("hotkeys disabled"); - return; - } - if (keycode == 16) return; // ignore lone shift if (keycode == 17) return; // ignore lone ctrl diff --git a/tt-rss.js b/tt-rss.js index 4386fe2e..c2099407 100644 --- a/tt-rss.js +++ b/tt-rss.js @@ -636,11 +636,9 @@ function rescoreCurrentFeed() { } function hotkey_handler(e) { - try { - var widget = dijit.getEnclosingWidget(e.target); - if (widget && Element.visible(widget.domNode)) return; + if (e.target.nodeName == "INPUT") return; var keycode; var shift_key = false; @@ -669,17 +667,6 @@ function hotkey_handler(e) { closeInfoBox(); } - var dialog = dijit.byId("infoBox"); - var dialog_visible = false; - - if (dialog) - dialog_visible = Element.visible(dialog.domNode); - - if (dialog_visible || !hotkeys_enabled) { - console.log("hotkeys disabled"); - return; - } - if (keycode == 16) return; // ignore lone shift if (keycode == 17) return; // ignore lone ctrl diff --git a/viewfeed.js b/viewfeed.js index 2b837be7..e9c6e8e5 100644 --- a/viewfeed.js +++ b/viewfeed.js @@ -363,7 +363,6 @@ function view(id) { console.log("cache check result: " + (cached_article != false)); - enableHotkeys(); hideAuxDlg(); var query = "?op=view&id=" + param_escape(id);