Skip to content

Commit 6d12f8b

Browse files
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>
1 parent 2f538bb commit 6d12f8b

20 files changed

+48
-16
lines changed

apps/files/js/fileactions.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,7 @@
370370
var menu;
371371
var $trigger = context.$file.closest('tr').find('.fileactions .action-menu');
372372
$trigger.addClass('open');
373+
$trigger.attr('aria-expanded', 'true');
373374

374375
menu = new OCA.Files.FileActionsMenu();
375376

@@ -378,6 +379,7 @@
378379
menu.$el.on('afterHide', function() {
379380
context.$file.removeClass('mouseOver');
380381
$trigger.removeClass('open');
382+
$trigger.attr('aria-expanded', 'false');
381383
menu.remove();
382384
});
383385

@@ -404,6 +406,7 @@
404406
}, false, context);
405407

406408
$el.addClass('permanent');
409+
$el.attr('aria-expanded', 'false');
407410

408411
},
409412

apps/files/js/filelist.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3853,7 +3853,7 @@
38533853

38543854
$actionsContainer.prepend($newButton);
38553855
$newButton.tooltip({'placement': 'bottom'});
3856-
3856+
$newButton.attr('aria-expanded', 'false');
38573857
$newButton.click(_.bind(this._onClickNewButton, this));
38583858
this._newButton = $newButton;
38593859
},
@@ -3864,6 +3864,7 @@
38643864
$target = $target.closest('.button');
38653865
}
38663866
this._newButton.tooltip('hide');
3867+
$target.attr('aria-expanded', 'true');
38673868
event.preventDefault();
38683869
if ($target.hasClass('disabled')) {
38693870
return false;

apps/files/js/navigation.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,13 @@
200200

201201
if ($menu.hasClass('collapsible') && $menu.data('expandedstate')) {
202202
$menu.toggleClass('open');
203+
var targetAriaExpanded = $target.attr('aria-expanded');
204+
if (targetAriaExpanded === 'false') {
205+
$target.attr('aria-expanded', 'true');
206+
} else if (targetAriaExpanded === 'true') {
207+
$target.attr('aria-expanded', 'false');
208+
}
209+
$menu.toggleAttr('data-expanded', 'true', 'false');
203210
var show = $menu.hasClass('open') ? 1 : 0;
204211
var key = $menu.data('expandedstate');
205212
$.post(OC.generateUrl("/apps/files/api/v1/toggleShowFolder/" + key), {show: show});

apps/files/js/newfilemenu.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@
245245
*/
246246
showAt: function($target) {
247247
this.render();
248-
OC.showMenu(null, this.$el);
248+
OC.showMenu($target, this.$el);
249249
}
250250
});
251251

apps/files/templates/appnavigation.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ class="nav-icon-<?php p(isset($item['icon']) && $item['icon'] !== '' ? $item['ic
9090
NavigationElementMenu($item);
9191
if (isset($item['sublist'])) {
9292
?>
93-
<button class="collapse app-navigation-noclose"
93+
<button class="collapse app-navigation-noclose" aria-expanded="<?= !empty($item['defaultExpandedState']) ? 'true' : 'false' ?>"
9494
aria-label="<?php p($l->t('Toggle %1$s sublist', $item['name'])) ?>"
9595
<?php if (sizeof($item['sublist']) == 0) { ?> style="display: none" <?php } ?>>
9696
</button>

apps/settings/js/federationsettingsview.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@
106106
self._onScopeChanged(field, scope);
107107
});
108108
$icon.append(scopeMenu.$el);
109+
$icon.attr('aria-expanded', 'false');
109110
$icon.on('click', _.bind(scopeMenu.show, scopeMenu));
110111
$icon.on('keydown', function(e) {
111112
if (e.keyCode === 32) {

apps/systemtags/js/admin.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
this.collection.fetch({
3939
success: function() {
4040
$('#systemtag').select2(_.extend(self.select2));
41+
$('#systemtag').parent().children('.select2-container').attr('aria-expanded', 'false')
4142
}
4243
});
4344

@@ -50,6 +51,12 @@
5051
$('#systemtag_submit').on('click', _.bind(this._onClickSubmit, this));
5152
$('#systemtag_delete').on('click', _.bind(this._onClickDelete, this));
5253
$('#systemtag_reset').on('click', _.bind(this._onClickReset, this));
54+
$('#systemtag').select2(_.extend(self.select2)).on('select2-open', () => {
55+
$('.select2-container').attr('aria-expanded', 'true')
56+
});
57+
$('#systemtag').select2(_.extend(self.select2)).on('select2-close', () => {
58+
$('.select2-container').attr('aria-expanded', 'false')
59+
});
5360
},
5461

5562
/**

apps/systemtags/src/systemtagsfilelist.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,13 @@
181181
return t('systemtags', 'No tags found')
182182
},
183183
})
184+
this.$filterField.parent().children('.select2-container').attr('aria-expanded', 'false')
185+
this.$filterField.on('select2-open', () => {
186+
this.$filterField.parent().children('.select2-container').attr('aria-expanded', 'true')
187+
})
188+
this.$filterField.on('select2-close', () => {
189+
this.$filterField.parent().children('.select2-container').attr('aria-expanded', 'false')
190+
})
184191
this.$filterField.on(
185192
'change',
186193
_.bind(this._onTagsChanged, this)

apps/theming/js/3rdparty/jscolor/jscolor.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1354,13 +1354,15 @@ var jsc = {
13541354

13551355

13561356
function detachPicker () {
1357+
THIS.targetElement.setAttribute('aria-expanded', 'false');
13571358
jsc.unsetClass(THIS.targetElement, THIS.activeClass);
13581359
jsc.picker.wrap.parentNode.removeChild(jsc.picker.wrap);
13591360
delete jsc.picker.owner;
13601361
}
13611362

13621363

13631364
function drawPicker () {
1365+
THIS.targetElement.setAttribute('aria-expanded', 'true');
13641366

13651367
// At this point, when drawing the picker, we know what the parent elements are
13661368
// and we can do all related DOM operations, such as registering events on them

apps/theming/js/settings-admin.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ window.addEventListener('DOMContentLoaded', function () {
9898

9999
// manually instantiate jscolor to work around new Function call which violates strict CSP
100100
var colorElement = $('#theming-color')[0];
101+
colorElement.setAttribute('aria-expanded', 'false');
101102
var jscolor = new window.jscolor(colorElement, {hash: true});
102103

103104
$('#theming .theme-undo').each(function() {

0 commit comments

Comments
 (0)