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>
This commit is contained in:
julia.kirschenheuter 2022-08-04 08:45:57 +02:00 committed by nextcloud-command
parent 2f538bb20f
commit 6d12f8b8a1
20 changed files with 48 additions and 16 deletions

View file

@ -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');
},

View file

@ -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;

View file

@ -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});

View file

@ -245,7 +245,7 @@
*/
showAt: function($target) {
this.render();
OC.showMenu(null, this.$el);
OC.showMenu($target, this.$el);
}
});

View file

@ -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>

View file

@ -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) {

View file

@ -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')
});
},
/**

View file

@ -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)

View file

@ -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

View file

@ -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() {

View file

@ -111,6 +111,9 @@ export const hideMenus = function(complete) {
// Set menu to closed
$('.menutoggle').attr('aria-expanded', false)
if (currentMenuToggle) {
currentMenuToggle.attr('aria-expanded', false)
}
$('.openedMenu').removeClass('openedMenu')
currentMenu = null

View file

@ -28,7 +28,7 @@
href="#"
:aria-label="ariaLabel"
:aria-controls="`header-menu-${id}`"
:aria-expanded="opened"
:aria-expanded="opened.toString()"
aria-haspopup="menu"
@click.prevent="toggleMenu">
<slot name="trigger" />

4
dist/core-login.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

4
dist/core-main.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long