diff options
author | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2018-08-22 09:47:00 +0200 |
---|---|---|
committer | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2018-08-22 09:54:40 +0200 |
commit | ba66cad1b46227d5a360aa688b114ad4d5cf0d4d (patch) | |
tree | 4305954ac50d4a91c76af6abc850729ec39059f9 | |
parent | e0f29cadaf1726b57b9fc045b0229d48b5898e88 (diff) | |
download | nextcloud-server-ba66cad1b46227d5a360aa688b114ad4d5cf0d4d.tar.gz nextcloud-server-ba66cad1b46227d5a360aa688b114ad4d5cf0d4d.zip |
Fix keyboard menu element event detection
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
-rw-r--r-- | core/js/js.js | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/core/js/js.js b/core/js/js.js index 2812cba988c..a4de1c3dbf6 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -684,7 +684,12 @@ var OCP = {}, registerMenu: function($toggle, $menuEl, toggle, headerMenu) { var self = this; $menuEl.addClass('menu'); - $toggle.on('click.menu keyup.menu', function(event) { + + // On link, the enter key trigger a click event + // Only use the click to avoid two fired events + $toggle.on($toggle.prop('tagName') === 'A' + ? 'click.menu' + : 'click.menu keyup.menu', function(event) { // prevent the link event (append anchor to URL) event.preventDefault(); @@ -1452,7 +1457,7 @@ function initCore() { function setupMainMenu() { // init the more-apps menu - OC.registerMenu($('#more-apps'), $('#navigation')); + OC.registerMenu($('#more-apps > a'), $('#navigation')); // toggle the navigation var $toggle = $('#header .header-appname-container'); |