From 30731c5505d5d6d09d4998c5968e0361ab9c9b79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Siiri=20Yl=C3=B6nen?= Date: Wed, 26 Jul 2023 10:20:53 +0300 Subject: [PATCH 1/3] Added tabindex to the focusable element. --- .../RecordDriver/DefaultRecord/record-image-paginator.phtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/finna2/templates/RecordDriver/DefaultRecord/record-image-paginator.phtml b/themes/finna2/templates/RecordDriver/DefaultRecord/record-image-paginator.phtml index ab3756260cf..52c96898f44 100644 --- a/themes/finna2/templates/RecordDriver/DefaultRecord/record-image-paginator.phtml +++ b/themes/finna2/templates/RecordDriver/DefaultRecord/record-image-paginator.phtml @@ -28,7 +28,7 @@
- +
<?=$this->transEsc('No Cover Image')?> From 9b66e50bb3a2827ada4fa57b578266296fe38198 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Siiri=20Yl=C3=B6nen?= Date: Wed, 2 Aug 2023 09:07:36 +0300 Subject: [PATCH 2/3] Tabindex to more/less buttons in seach results --- themes/finna2/js/finna-layout.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/themes/finna2/js/finna-layout.js b/themes/finna2/js/finna-layout.js index e2f510b3af2..2ced62a1d4d 100644 --- a/themes/finna2/js/finna-layout.js +++ b/themes/finna2/js/finna-layout.js @@ -121,6 +121,9 @@ finna.layout = (function finnaLayout() { } else { self.after([moreLink, lessLink]); } + if (self.parents('.search-results')) { + self.siblings('button').attr('tabindex', -1); + } } }); } From 9f7de010eb73c2799507127a2384d96cd928fefc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Siiri=20Yl=C3=B6nen?= Date: Fri, 18 Aug 2023 11:17:20 +0300 Subject: [PATCH 3/3] Tabindex set if element has it defined. --- themes/finna2/js/finna-layout.js | 7 ++++--- .../templates/RecordDriver/DefaultRecord/result-list.phtml | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/themes/finna2/js/finna-layout.js b/themes/finna2/js/finna-layout.js index 2ced62a1d4d..76b09ae4981 100644 --- a/themes/finna2/js/finna-layout.js +++ b/themes/finna2/js/finna-layout.js @@ -92,6 +92,10 @@ finna.layout = (function finnaLayout() { var moreLink = $(''); var lessLink = $(''); + if (self.attr('tabindex') === '-1') { + moreLink.attr('tabindex', '-1'); + lessLink.attr('tabindex', '-1'); + } var linkClass = self.data('button-class') || ''; if (linkClass) { moreLink.addClass(linkClass); @@ -121,9 +125,6 @@ finna.layout = (function finnaLayout() { } else { self.after([moreLink, lessLink]); } - if (self.parents('.search-results')) { - self.siblings('button').attr('tabindex', -1); - } } }); } diff --git a/themes/finna2/templates/RecordDriver/DefaultRecord/result-list.phtml b/themes/finna2/templates/RecordDriver/DefaultRecord/result-list.phtml index 5bc8a42b1b4..8d2d9076d72 100644 --- a/themes/finna2/templates/RecordDriver/DefaultRecord/result-list.phtml +++ b/themes/finna2/templates/RecordDriver/DefaultRecord/result-list.phtml @@ -74,7 +74,7 @@ driver->tryMethod('getAuthorsWithRoles'); if (!empty($authors)): ?> -
+
$author): ?> 0 ? '; ' : '')?>record($this->driver)->getLinkedFieldElement('author', $author['name'], $author, ['date' => true, 'role' => true, 'authorityType' => $author['type'] ?? null])?>