diff --git a/settings/js/federationscopemenu.js b/settings/js/federationscopemenu.js index e55b26198e..29303258c9 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 10c671bad6..7ab08db206 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 "