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; _infscroll_request_sent = timestamp;
} }
enableHotkeys();
hideAuxDlg(); hideAuxDlg();
closeInfoBox(); closeInfoBox();

View File

@ -1,4 +1,3 @@
var hotkeys_enabled = true;
var notify_silent = false; var notify_silent = false;
var loading_progress = 0; var loading_progress = 0;
var sanity_check_done = false; var sanity_check_done = false;
@ -84,15 +83,6 @@ function format_exception_error(location, e) {
return msg; return msg;
} }
function disableHotkeys() {
hotkeys_enabled = false;
}
function enableHotkeys() {
hotkeys_enabled = true;
}
function param_escape(arg) { function param_escape(arg) {
if (typeof encodeURIComponent != 'undefined') if (typeof encodeURIComponent != 'undefined')
return encodeURIComponent(arg); return encodeURIComponent(arg);
@ -398,8 +388,6 @@ function closeErrorBox() {
if (Element.visible("errorBoxShadow")) { if (Element.visible("errorBoxShadow")) {
Element.hide("dialog_overlay"); Element.hide("dialog_overlay");
Element.hide("errorBoxShadow"); Element.hide("errorBoxShadow");
enableHotkeys();
} }
return false; return false;
@ -407,8 +395,6 @@ function closeErrorBox() {
function closeInfoBox(cleanup) { function closeInfoBox(cleanup) {
try { try {
enableHotkeys();
dialog = dijit.byId("infoBox"); dialog = dijit.byId("infoBox");
if (dialog) dialog.hide(); if (dialog) dialog.hide();

View File

@ -964,8 +964,7 @@ function validatePrefsReset() {
function pref_hotkey_handler(e) { function pref_hotkey_handler(e) {
try { try {
if (e.target.nodeName == "INPUT") return;
if (dijit.getEnclosingWidget(e.target)) return;
var keycode; var keycode;
var shift_key = false; var shift_key = false;
@ -994,17 +993,6 @@ function pref_hotkey_handler(e) {
closeInfoBox(); 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 == 16) return; // ignore lone shift
if (keycode == 17) return; // ignore lone ctrl if (keycode == 17) return; // ignore lone ctrl

View File

@ -636,11 +636,9 @@ function rescoreCurrentFeed() {
} }
function hotkey_handler(e) { function hotkey_handler(e) {
try { try {
var widget = dijit.getEnclosingWidget(e.target); if (e.target.nodeName == "INPUT") return;
if (widget && Element.visible(widget.domNode)) return;
var keycode; var keycode;
var shift_key = false; var shift_key = false;
@ -669,17 +667,6 @@ function hotkey_handler(e) {
closeInfoBox(); 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 == 16) return; // ignore lone shift
if (keycode == 17) return; // ignore lone ctrl if (keycode == 17) return; // ignore lone ctrl

View File

@ -363,7 +363,6 @@ function view(id) {
console.log("cache check result: " + (cached_article != false)); console.log("cache check result: " + (cached_article != false));
enableHotkeys();
hideAuxDlg(); hideAuxDlg();
var query = "?op=view&id=" + param_escape(id); var query = "?op=view&id=" + param_escape(id);