Skip to content

Commit

Permalink
Fix items search JS used with old markup
Browse files Browse the repository at this point in the history
The code for updating accessible labels fails if the labels aren't there
in the first place.
  • Loading branch information
zerocrates committed Oct 27, 2023
1 parent c6a2f0a commit 0881284
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions application/views/scripts/javascripts/items-search.js
Expand Up @@ -18,6 +18,9 @@ Omeka.Search = {};

function incrementScreenReaderLabels(attribute, element, index) {
var oldAttribute = element.attr(attribute);
if (!oldAttribute) {
return;
}
var newAttribute = oldAttribute.replace(/\d+/, parseInt(index) + 1);
element.attr(attribute, newAttribute);
}
Expand Down

0 comments on commit 0881284

Please sign in to comment.