diff options
author | Morris Jobke <hey@morrisjobke.de> | 2018-07-25 00:07:37 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-25 00:07:37 +0200 |
commit | a96137ef0bbe707d58227e0635209cf28f78e934 (patch) | |
tree | 09b147d8773f2dfad5af7a90f69eab02ac32c199 /core | |
parent | f5e4fcadd99a734939f4a0ff09325c6171a6792c (diff) | |
parent | fe2509231213409238c8243c8211bcab0bc4a00b (diff) | |
download | nextcloud-server-a96137ef0bbe707d58227e0635209cf28f78e934.tar.gz nextcloud-server-a96137ef0bbe707d58227e0635209cf28f78e934.zip |
Merge pull request #10310 from nextcloud/accessibility-header
Accessibility fixes for header and global elements
Diffstat (limited to 'core')
-rw-r--r-- | core/css/header.scss | 11 | ||||
-rw-r--r-- | core/css/styles.scss | 9 | ||||
-rw-r--r-- | core/js/js.js | 31 |
3 files changed, 40 insertions, 11 deletions
diff --git a/core/css/header.scss b/core/css/header.scss index b7565281218..1e962461da1 100644 --- a/core/css/header.scss +++ b/core/css/header.scss @@ -345,17 +345,13 @@ nav[role='navigation'] { opacity: 1; /* override icon opacity */ padding-right: 12px; - img { - opacity: .7; - margin-bottom: -2px; - } &:hover, &:focus, &:active { color: var(--color-primary-text); img, #expandDisplayName { - opacity: 1; + opacity: .57 !important; } } @@ -482,7 +478,8 @@ nav[role='navigation'] { } li:hover span, - li:focus span { + li:focus span, + li a:focus span { display: inline-block; } @@ -562,7 +559,7 @@ nav[role='navigation'] { padding: 11px; position: absolute; overflow: hidden; - z-index: 1000; + z-index: 9999; top: -999px; left: 3px; /* Force primary color, otherwise too light focused color */ diff --git a/core/css/styles.scss b/core/css/styles.scss index ee524d336f5..7a66ab47846 100644 --- a/core/css/styles.scss +++ b/core/css/styles.scss @@ -794,7 +794,12 @@ span.ui-icon { background-size: 16px 16px; padding: 14px; cursor: pointer; - opacity: .6; + + &:hover, + &:focus, + &:active { + opacity: 1 !important; + } } } @@ -1026,6 +1031,8 @@ div.crumb { } } &:hover, &:focus, a:focus, &:active { + opacity: 1; + > a, > span { opacity: .7; diff --git a/core/js/js.js b/core/js/js.js index ef80186b985..2812cba988c 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -684,10 +684,15 @@ var OCP = {}, registerMenu: function($toggle, $menuEl, toggle, headerMenu) { var self = this; $menuEl.addClass('menu'); - $toggle.on('click.menu', function(event) { + $toggle.on('click.menu keyup.menu', function(event) { // prevent the link event (append anchor to URL) event.preventDefault(); + // allow enter key as a trigger + if (event.key && event.key !== "Enter") { + return; + } + if ($menuEl.is(OC._currentMenu)) { self.hideMenus(); return; @@ -1422,7 +1427,14 @@ function initCore() { OC.registerMenu($('#expand'), $('#expanddiv'), false, true); // toggle for menus + //$(document).on('mouseup.closemenus keyup', function(event) { $(document).on('mouseup.closemenus', function(event) { + + // allow enter as a trigger + // if (event.key && event.key !== "Enter") { + // return; + // } + var $el = $(event.target); if ($el.closest('.menu').length || $el.closest('.menutoggle').length) { // don't close when clicking on the menu directly or a menu toggle @@ -1617,14 +1629,27 @@ function initCore() { maxPosition: 300, // $navigation-width minDragDistance: 100 }); - $('#app-content').prepend('<div id="app-navigation-toggle" class="icon-menu" style="display:none;"></div>'); - $('#app-navigation-toggle').click(function(){ + + $('#app-content').prepend('<div id="app-navigation-toggle" class="icon-menu" style="display:none;" tabindex="0"></div>'); + + var toggleSnapperOnButton = function(){ if(snapper.state().state == 'left'){ snapper.close(); } else { snapper.open('left'); } + }; + + $('#app-navigation-toggle').click(function(){ + toggleSnapperOnButton(); }); + + $('#app-navigation-toggle').keypress(function(e) { + if(e.which == 13) { + toggleSnapperOnButton(); + } + }); + // close sidebar when switching navigation entry var $appNavigation = $('#app-navigation'); $appNavigation.delegate('a, :button', 'click', function(event) { |