rework hotkey blocking on INPUT elements

This commit is contained in:
Andrew Dolgov 2010-11-21 13:52:01 +03:00
parent a304240454
commit 4aeafea283
5 changed files with 2 additions and 43 deletions

View File

@ -82,7 +82,6 @@ function viewfeed(feed, subop, is_cat, offset) {
_infscroll_request_sent = timestamp;
}
enableHotkeys();
hideAuxDlg();
closeInfoBox();

View 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();

View File

@ -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

View File

@ -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

View 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);