diff options
author | julia.kirschenheuter <julia.kirschenheuter@nextcloud.com> | 2022-08-04 08:45:57 +0200 |
---|---|---|
committer | nextcloud-command <nextcloud-command@users.noreply.github.com> | 2022-08-17 19:28:40 +0000 |
commit | 6d12f8b8a146cf789f924b9c0de16ddd05a92ae4 (patch) | |
tree | 60f1505d4ca2c8bfbdc1649f1b87493f6ec190c5 /apps | |
parent | 2f538bb20f7859b2f09d0d088be9ee47c6cdadde (diff) | |
download | nextcloud-server-6d12f8b8a146cf789f924b9c0de16ddd05a92ae4.tar.gz nextcloud-server-6d12f8b8a146cf789f924b9c0de16ddd05a92ae4.zip |
Add ```aria-expanded``` value to select2-container om systemtag and file tags
Add ```aria-expanded``` to color picker
Add ```aria-expanded``` to UnifiedSearch.vue
Add ```aria-expanded``` to new button on files
Add ```aria-expanded``` to action menu
Add ```aria-expanded``` to icon .federation-menu
Add ```aria-expanded``` to app navigation collapse button
Signed-off-by: julia.kirschenheuter <julia.kirschenheuter@nextcloud.com>
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files/js/fileactions.js | 3 | ||||
-rw-r--r-- | apps/files/js/filelist.js | 3 | ||||
-rw-r--r-- | apps/files/js/navigation.js | 7 | ||||
-rw-r--r-- | apps/files/js/newfilemenu.js | 2 | ||||
-rw-r--r-- | apps/files/templates/appnavigation.php | 2 | ||||
-rw-r--r-- | apps/settings/js/federationsettingsview.js | 1 | ||||
-rw-r--r-- | apps/systemtags/js/admin.js | 7 | ||||
-rw-r--r-- | apps/systemtags/src/systemtagsfilelist.js | 7 | ||||
-rw-r--r-- | apps/theming/js/3rdparty/jscolor/jscolor.js | 2 | ||||
-rw-r--r-- | apps/theming/js/settings-admin.js | 1 |
10 files changed, 32 insertions, 3 deletions
diff --git a/apps/files/js/fileactions.js b/apps/files/js/fileactions.js index 8790eae9c98..9b86c6521ae 100644 --- a/apps/files/js/fileactions.js +++ b/apps/files/js/fileactions.js @@ -370,6 +370,7 @@ var menu; var $trigger = context.$file.closest('tr').find('.fileactions .action-menu'); $trigger.addClass('open'); + $trigger.attr('aria-expanded', 'true'); menu = new OCA.Files.FileActionsMenu(); @@ -378,6 +379,7 @@ menu.$el.on('afterHide', function() { context.$file.removeClass('mouseOver'); $trigger.removeClass('open'); + $trigger.attr('aria-expanded', 'false'); menu.remove(); }); @@ -404,6 +406,7 @@ }, false, context); $el.addClass('permanent'); + $el.attr('aria-expanded', 'false'); }, diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index 4acefa6902b..8407cb79bb3 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -3853,7 +3853,7 @@ $actionsContainer.prepend($newButton); $newButton.tooltip({'placement': 'bottom'}); - + $newButton.attr('aria-expanded', 'false'); $newButton.click(_.bind(this._onClickNewButton, this)); this._newButton = $newButton; }, @@ -3864,6 +3864,7 @@ $target = $target.closest('.button'); } this._newButton.tooltip('hide'); + $target.attr('aria-expanded', 'true'); event.preventDefault(); if ($target.hasClass('disabled')) { return false; diff --git a/apps/files/js/navigation.js b/apps/files/js/navigation.js index f8f15394ef0..8a2cddb3f52 100644 --- a/apps/files/js/navigation.js +++ b/apps/files/js/navigation.js @@ -200,6 +200,13 @@ if ($menu.hasClass('collapsible') && $menu.data('expandedstate')) { $menu.toggleClass('open'); + var targetAriaExpanded = $target.attr('aria-expanded'); + if (targetAriaExpanded === 'false') { + $target.attr('aria-expanded', 'true'); + } else if (targetAriaExpanded === 'true') { + $target.attr('aria-expanded', 'false'); + } + $menu.toggleAttr('data-expanded', 'true', 'false'); var show = $menu.hasClass('open') ? 1 : 0; var key = $menu.data('expandedstate'); $.post(OC.generateUrl("/apps/files/api/v1/toggleShowFolder/" + key), {show: show}); diff --git a/apps/files/js/newfilemenu.js b/apps/files/js/newfilemenu.js index faebc305c6d..67ca8934549 100644 --- a/apps/files/js/newfilemenu.js +++ b/apps/files/js/newfilemenu.js @@ -245,7 +245,7 @@ */ showAt: function($target) { this.render(); - OC.showMenu(null, this.$el); + OC.showMenu($target, this.$el); } }); diff --git a/apps/files/templates/appnavigation.php b/apps/files/templates/appnavigation.php index 9ff680d6a8d..3c333d39fc0 100644 --- a/apps/files/templates/appnavigation.php +++ b/apps/files/templates/appnavigation.php @@ -90,7 +90,7 @@ function NavigationListElements($item, $l, $pinned) { NavigationElementMenu($item); if (isset($item['sublist'])) { ?> - <button class="collapse app-navigation-noclose" + <button class="collapse app-navigation-noclose" aria-expanded="<?= !empty($item['defaultExpandedState']) ? 'true' : 'false' ?>" aria-label="<?php p($l->t('Toggle %1$s sublist', $item['name'])) ?>" <?php if (sizeof($item['sublist']) == 0) { ?> style="display: none" <?php } ?>> </button> diff --git a/apps/settings/js/federationsettingsview.js b/apps/settings/js/federationsettingsview.js index e05cc9f20f4..eb5d7084206 100644 --- a/apps/settings/js/federationsettingsview.js +++ b/apps/settings/js/federationsettingsview.js @@ -106,6 +106,7 @@ self._onScopeChanged(field, scope); }); $icon.append(scopeMenu.$el); + $icon.attr('aria-expanded', 'false'); $icon.on('click', _.bind(scopeMenu.show, scopeMenu)); $icon.on('keydown', function(e) { if (e.keyCode === 32) { diff --git a/apps/systemtags/js/admin.js b/apps/systemtags/js/admin.js index b8bcbb51e6f..0b9d9ec4a41 100644 --- a/apps/systemtags/js/admin.js +++ b/apps/systemtags/js/admin.js @@ -38,6 +38,7 @@ this.collection.fetch({ success: function() { $('#systemtag').select2(_.extend(self.select2)); + $('#systemtag').parent().children('.select2-container').attr('aria-expanded', 'false') } }); @@ -50,6 +51,12 @@ $('#systemtag_submit').on('click', _.bind(this._onClickSubmit, this)); $('#systemtag_delete').on('click', _.bind(this._onClickDelete, this)); $('#systemtag_reset').on('click', _.bind(this._onClickReset, this)); + $('#systemtag').select2(_.extend(self.select2)).on('select2-open', () => { + $('.select2-container').attr('aria-expanded', 'true') + }); + $('#systemtag').select2(_.extend(self.select2)).on('select2-close', () => { + $('.select2-container').attr('aria-expanded', 'false') + }); }, /** diff --git a/apps/systemtags/src/systemtagsfilelist.js b/apps/systemtags/src/systemtagsfilelist.js index 404c85ea3f8..69e63706264 100644 --- a/apps/systemtags/src/systemtagsfilelist.js +++ b/apps/systemtags/src/systemtagsfilelist.js @@ -181,6 +181,13 @@ return t('systemtags', 'No tags found') }, }) + this.$filterField.parent().children('.select2-container').attr('aria-expanded', 'false') + this.$filterField.on('select2-open', () => { + this.$filterField.parent().children('.select2-container').attr('aria-expanded', 'true') + }) + this.$filterField.on('select2-close', () => { + this.$filterField.parent().children('.select2-container').attr('aria-expanded', 'false') + }) this.$filterField.on( 'change', _.bind(this._onTagsChanged, this) diff --git a/apps/theming/js/3rdparty/jscolor/jscolor.js b/apps/theming/js/3rdparty/jscolor/jscolor.js index cad36eab92a..9e6e8db8853 100644 --- a/apps/theming/js/3rdparty/jscolor/jscolor.js +++ b/apps/theming/js/3rdparty/jscolor/jscolor.js @@ -1354,6 +1354,7 @@ var jsc = { function detachPicker () { + THIS.targetElement.setAttribute('aria-expanded', 'false'); jsc.unsetClass(THIS.targetElement, THIS.activeClass); jsc.picker.wrap.parentNode.removeChild(jsc.picker.wrap); delete jsc.picker.owner; @@ -1361,6 +1362,7 @@ var jsc = { function drawPicker () { + THIS.targetElement.setAttribute('aria-expanded', 'true'); // At this point, when drawing the picker, we know what the parent elements are // and we can do all related DOM operations, such as registering events on them diff --git a/apps/theming/js/settings-admin.js b/apps/theming/js/settings-admin.js index 7efdab6dda4..b33beda43d8 100644 --- a/apps/theming/js/settings-admin.js +++ b/apps/theming/js/settings-admin.js @@ -98,6 +98,7 @@ window.addEventListener('DOMContentLoaded', function () { // manually instantiate jscolor to work around new Function call which violates strict CSP var colorElement = $('#theming-color')[0]; + colorElement.setAttribute('aria-expanded', 'false'); var jscolor = new window.jscolor(colorElement, {hash: true}); $('#theming .theme-undo').each(function() { |