From dd3b689e6575dd2fb0666ef7b5ae0eccd43e4947 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Wed, 21 Oct 2020 11:15:50 +0000 Subject: [PATCH] Bug 26761: Use aria-disabled attribute in OPAC cart for disabled links This patch adds "aria-disabled" attributes to disabled links in the Cart, and adds JS to change the value from "true" to "false" when the links are enabled. The goal is to make the interface more informative to users of screen readers. To test, apply the patch and add some items to the Cart in the OPAC. - Inspect the markup of controls like "Remove", "Place hold," etc. Each should look disabled (grey) and has the correct aria-disabled attribute value. - Select one or more checkboxes. The links should be come active, and the aria-disabled attribute shoulk now be "false." - Deselect all checkboxes. The links should now be disabled. Signed-off-by: Lucas Gass Signed-off-by: Tomas Cohen Arazi --- .../opac-tmpl/bootstrap/en/modules/opac-basket.tt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt index 5a6eaf8772..3becf590f8 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt @@ -55,16 +55,16 @@ Select titles to: - Remove + Remove [% IF ( Koha.Preference( 'opacuserlogin' ) == 1 ) %] [% IF ( ( Koha.Preference( 'virtualshelves' ) == 1 ) && loggedinusername ) %] - Add to a list + Add to a list [% END %] [% IF ( Koha.Preference( 'RequestOnOpac' ) == 1 ) %] - Place hold + Place hold [% END %] [% IF ( TagsInputEnabled && loggedinusername ) %] - Tag + Tag [% END %] [% END # / IF opacuserlogin %] @@ -500,10 +500,10 @@ var checkedBoxes = $(".cb:checked"); if ( checkedBoxes.length ) { $(".selections").html(_("With selected titles: ")); - $(".selections-toolbar .links a").removeClass("disabled"); + $(".selections-toolbar .links a").removeClass("disabled").attr("aria-disabled", "false"); } else { $(".selections").html(_("Select titles to: ")); - $(".selections-toolbar .links a").addClass("disabled"); + $(".selections-toolbar .links a").addClass("disabled").attr("aria-disabled", "true"); } } -- 2.32.0