From 2a7150bf6ff862efa96ca724141431d426f20772 Mon Sep 17 00:00:00 2001 From: neuroalien <105230050+neuroalien@users.noreply.github.com> Date: Sun, 28 Jan 2024 11:06:53 +0000 Subject: [PATCH] AO3-6566 ARIA controls must contain the exact ID (#4590) The ID of the modal controlled by the link to modal is `modal`. The hash sign must not be included in the reference to the element. As per Sarken's comment, I've removed the redundant setting of the aria attribute in HTML options, since it's always overwritten by the JavaScript. --- app/helpers/application_helper.rb | 2 +- public/javascripts/ao3modal.js | 2 +- public/javascripts/ao3modal.min.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 8f5054c9782..616ad862b04 100755 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -150,7 +150,7 @@ def link_to_modal(content = "", options = {}) options[:for] ||= "" options[:title] ||= options[:for] - html_options = { "class" => options[:class] + " modal", "title" => options[:title], "aria-controls" => "#modal" } + html_options = { class: "#{options[:class]} modal", title: options[:title] } link_to content, options[:for], html_options end diff --git a/public/javascripts/ao3modal.js b/public/javascripts/ao3modal.js index b2b161a9a25..3f16fae3a5e 100644 --- a/public/javascripts/ao3modal.js +++ b/public/javascripts/ao3modal.js @@ -193,7 +193,7 @@ jQuery(document).ready(function() { .append(img); a.addClass('modal modal-attached') - .attr('aria-controls', '#modal') + .attr('aria-controls', 'modal') .filter(function() { return $(this).closest('.userstuff').length === 0; }).click(function(event){ diff --git a/public/javascripts/ao3modal.min.js b/public/javascripts/ao3modal.min.js index 8220d37f538..612e7128521 100644 --- a/public/javascripts/ao3modal.min.js +++ b/public/javascripts/ao3modal.min.js @@ -1 +1 @@ -jQuery(document).ready((function(){window.ao3modal=function(t){var e,a,i,o,s,n,l,d,r,c,p,h,m=!1,g=t("
").css({width:"100%",height:200}),s=t("
").css({width:"100%",height:200}),c=t("