diff --git a/program/js/app.js b/program/js/app.js index 87f0e2675..749b51654 100644 --- a/program/js/app.js +++ b/program/js/app.js @@ -3495,7 +3495,7 @@ function rcube_webmail() // go to specified page var p = parseInt(this.value); if (p && p != ref.env.current_page && !ref.busy) { - ref.hide_menu('pagejump-selector'); + ref.hide_menu('pagejump-selector', e); ref.list_page(p); } }); @@ -8262,8 +8262,7 @@ function rcube_webmail() this.focused_menu = null; this.menu_keyboard_active = false; } - } - + }; // position a menu element on the screen in relation to other object this.element_position = function(element, obj) diff --git a/program/js/common.js b/program/js/common.js index 7c2745fb1..cbc6a794a 100644 --- a/program/js/common.js +++ b/program/js/common.js @@ -283,10 +283,13 @@ cancel: function(evt) */ is_keyboard: function(e) { - return e && ( - (e.type && String(e.type).match(/^key/)) // DOM3-compatible - || (!e.pageX && (e.pageY || 0) <= 0 && !e.clientX && (e.clientY || 0) <= 0) // others - ); + if (!e) + return false; + + if (e.type) + return !!e.type.match(/^key/); // DOM3-compatible + + return !e.pageX && (e.pageY || 0) <= 0 && !e.clientX && (e.clientY || 0) <= 0; }, /**