diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2019-03-22 11:58:53 +0100 |
---|---|---|
committer | Christoph Wurst <christoph@winzerhof-wurst.at> | 2019-03-22 11:58:53 +0100 |
commit | 5926ff95e1a31dd3991829b3aab4f8b54f137521 (patch) | |
tree | 190a092eda9de534fcf32b17bc7419b3f7d73738 /settings/js | |
parent | f127de0ab2bf94c985a173ae21c99d9c72b8f858 (diff) | |
download | nextcloud-server-5926ff95e1a31dd3991829b3aab4f8b54f137521.tar.gz nextcloud-server-5926ff95e1a31dd3991829b3aab4f8b54f137521.zip |
Make the federation scope selectable via keyboard
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'settings/js')
-rw-r--r-- | settings/js/federationscopemenu.js | 13 | ||||
-rw-r--r-- | settings/js/templates.js | 2 | ||||
-rw-r--r-- | settings/js/templates/federationscopemenu.handlebars | 2 |
3 files changed, 13 insertions, 4 deletions
diff --git a/settings/js/federationscopemenu.js b/settings/js/federationscopemenu.js index e55b26198eb..29303258c98 100644 --- a/settings/js/federationscopemenu.js +++ b/settings/js/federationscopemenu.js @@ -57,7 +57,8 @@ _context: null, events: { - 'click a.action': '_onClickAction' + 'click a.action': '_onSelectScope', + 'keydown a.action': '_onSelectScopeKeyboard' }, /** @@ -65,7 +66,7 @@ * * @param {Object} event event object */ - _onClickAction: function(event) { + _onSelectScope: function(event) { var $target = $(event.currentTarget); if (!$target.hasClass('menuitem')) { $target = $target.closest('.menuitem'); @@ -76,6 +77,14 @@ OC.hideMenus(); }, + _onSelectScopeKeyboard: function(event) { + if (event.keyCode === 13 || event.keyCode === 32) { + // Enter and space can be used to select a scope + event.preventDefault(); + this._onSelectScope(event); + } + }, + /** * Renders the menu with the currently set items */ diff --git a/settings/js/templates.js b/settings/js/templates.js index 10c671bad60..7ab08db2065 100644 --- a/settings/js/templates.js +++ b/settings/js/templates.js @@ -3,7 +3,7 @@ templates['federationscopemenu'] = template({"1":function(container,depth0,helpers,partials,data) { var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression; - return " <li>\n <a href=\"#\" class=\"menuitem action action-" + return " <li tabindex=\"0\">\n <a href=\"#\" class=\"menuitem action action-" + alias4(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"name","hash":{},"data":data}) : helper))) + " permanent " + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.active : depth0),{"name":"if","hash":{},"fn":container.program(2, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") diff --git a/settings/js/templates/federationscopemenu.handlebars b/settings/js/templates/federationscopemenu.handlebars index e5cfd942f46..4bd945b094d 100644 --- a/settings/js/templates/federationscopemenu.handlebars +++ b/settings/js/templates/federationscopemenu.handlebars @@ -1,6 +1,6 @@ <ul> {{#each items}} - <li> + <li tabindex="0"> <a href="#" class="menuitem action action-{{name}} permanent {{#if active}}active{{/if}}" data-action="{{name}}"> {{#if iconClass}} <span class="icon {{iconClass}}"></span> |