From cc53efe4dd8c962a0900582c1e919a8f8182c183 Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Mon, 29 Aug 2022 22:40:49 +0200 Subject: [PATCH] Add a11y attributes for legacy app navigation Aded "role=navigation" Added "aria-current=page" for the currently selected item. Signed-off-by: Vincent Petry --- apps/files/js/navigation.js | 4 ++-- apps/files/templates/appnavigation.php | 2 +- apps/settings/templates/help.php | 6 +++--- apps/settings/templates/settings/frame.php | 12 +++++------- 4 files changed, 11 insertions(+), 13 deletions(-) diff --git a/apps/files/js/navigation.js b/apps/files/js/navigation.js index 8a2cddb3f52a0..d7ae7dd7fee87 100644 --- a/apps/files/js/navigation.js +++ b/apps/files/js/navigation.js @@ -141,13 +141,13 @@ } return; } - this.$el.find('li a').removeClass('active'); + this.$el.find('li a').removeClass('active').removeAttr('aria-current'); if (this.$currentContent) { this.$currentContent.addClass('hidden'); this.$currentContent.trigger(jQuery.Event('hide')); } this._activeItem = itemId; - currentItem.children('a').addClass('active'); + currentItem.children('a').addClass('active').attr('aria-current', 'page'); this.$currentContent = $('#app-content-' + (typeof itemView === 'string' && itemView !== '' ? itemView : itemId)); this.$currentContent.removeClass('hidden'); if (!options || !options.silent) { diff --git a/apps/files/templates/appnavigation.php b/apps/files/templates/appnavigation.php index 3c333d39fc064..91fdfa32b10b2 100644 --- a/apps/files/templates/appnavigation.php +++ b/apps/files/templates/appnavigation.php @@ -1,4 +1,4 @@ -