From 2495f4498b97bef677233a7d3fb2db98788520d3 Mon Sep 17 00:00:00 2001 From: pilgrim2308 Date: Thu, 18 Feb 2021 11:09:15 +0530 Subject: [PATCH] recent_topic: Add role and area properties according to MDN docs. Add role and area properties to recent topics filter buttons. --- static/js/recent_topics.js | 6 ++++-- static/templates/recent_topics_filters.hbs | 6 +++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/static/js/recent_topics.js b/static/js/recent_topics.js index 047694ab9f..61d5f365d9 100644 --- a/static/js/recent_topics.js +++ b/static/js/recent_topics.js @@ -397,12 +397,14 @@ function show_selected_filters() { if (filters.size === 0) { $("#recent_topics_filter_buttons") .find('[data-filter="all"]') - .addClass("btn-recent-selected"); + .addClass("btn-recent-selected") + .attr("aria-checked", "true"); } else { for (const filter of filters) { $("#recent_topics_filter_buttons") .find(`[data-filter="${CSS.escape(filter)}"]`) - .addClass("btn-recent-selected"); + .addClass("btn-recent-selected") + .attr("aria-checked", "true"); } } } diff --git a/static/templates/recent_topics_filters.hbs b/static/templates/recent_topics_filters.hbs index 79af486c3c..c2adf74e39 100644 --- a/static/templates/recent_topics_filters.hbs +++ b/static/templates/recent_topics_filters.hbs @@ -1,5 +1,5 @@ - - -