Fix passing event argument when hiding the pagejump-selector menu

and fix keyboard event detection.
pull/6040/head
Aleksander Machniak 7 years ago
parent 91826a755b
commit 45aff25c66

@ -3495,7 +3495,7 @@ function rcube_webmail()
// go to specified page // go to specified page
var p = parseInt(this.value); var p = parseInt(this.value);
if (p && p != ref.env.current_page && !ref.busy) { if (p && p != ref.env.current_page && !ref.busy) {
ref.hide_menu('pagejump-selector'); ref.hide_menu('pagejump-selector', e);
ref.list_page(p); ref.list_page(p);
} }
}); });
@ -8262,8 +8262,7 @@ function rcube_webmail()
this.focused_menu = null; this.focused_menu = null;
this.menu_keyboard_active = false; this.menu_keyboard_active = false;
} }
} };
// position a menu element on the screen in relation to other object // position a menu element on the screen in relation to other object
this.element_position = function(element, obj) this.element_position = function(element, obj)

@ -283,10 +283,13 @@ cancel: function(evt)
*/ */
is_keyboard: function(e) is_keyboard: function(e)
{ {
return e && ( if (!e)
(e.type && String(e.type).match(/^key/)) // DOM3-compatible return false;
|| (!e.pageX && (e.pageY || 0) <= 0 && !e.clientX && (e.clientY || 0) <= 0) // others
); if (e.type)
return !!e.type.match(/^key/); // DOM3-compatible
return !e.pageX && (e.pageY || 0) <= 0 && !e.clientX && (e.clientY || 0) <= 0;
}, },
/** /**

Loading…
Cancel
Save