]> git.wh0rd.org Git - tt-rss.git/commitdiff
rework hotkey blocking on INPUT elements
authorAndrew Dolgov <fox@fakecake.org>
Sun, 21 Nov 2010 10:52:01 +0000 (13:52 +0300)
committerAndrew Dolgov <fox@fakecake.org>
Sun, 21 Nov 2010 10:52:01 +0000 (13:52 +0300)
feedlist.js
functions.js
prefs.js
tt-rss.js
viewfeed.js

index 05a16d865bc5ccbad4b6771467a4a258d1053a63..a39748f1c4d325761575712fda20f70fc50b1002 100644 (file)
@@ -82,7 +82,6 @@ function viewfeed(feed, subop, is_cat, offset) {
                        _infscroll_request_sent = timestamp;                    
                }
 
-               enableHotkeys();
                hideAuxDlg();
                closeInfoBox();
 
index 935740b9436a82f04f750ad3f3ce3a5877847752..8e02b79321b77159e4358b9c90cd7b2651b2a703 100644 (file)
@@ -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();
index 3a36c28766d305dcf2deaf7cdaf9859676291ef7..4851611a384e8f9ca724690ad437d3d8e17d2f76 100644 (file)
--- 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
 
index 4386fe2eeddb281d8414d2214a8777e4b7471b21..c20994076db0f6af2f4aba0a914132015a6bdb55 100644 (file)
--- 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
 
index 2b837be73af428f75df7e99cf6f2f5c68fb84d6c..e9c6e8e5446d0db67c17d43296ff5ba5dbac2616 100644 (file)
@@ -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);