Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FINNA-450] Fix focus targeting cover images on search page #2654

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions themes/finna2/js/finna-layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ finna.layout = (function finnaLayout() {
var moreLink = $('<button type="button" class="more-link" aria-hidden="true">' + moreLabel + VuFind.icon('show-more') + '</button>');
var lessLink = $('<button type="button" class="less-link" aria-hidden="true">' + lessLabel + VuFind.icon('show-less') + '</button>');

if (self.attr('tabindex') === '-1') {
moreLink.attr('tabindex', '-1');
lessLink.attr('tabindex', '-1');
}
var linkClass = self.data('button-class') || '';
if (linkClass) {
moreLink.addClass(linkClass);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<?php if (!empty($images[0]['urls']['medium']) || !empty($images[0]['urls']['large'])): ?>
<div class="recordcover-container">
<button class="next-image left" type="button"><?=$this->icon('image-previous') ?><span class="sr-only"><?= $this->transEsc('previous_image') ?></span></button>
<a class="image-popup-trigger init" draggable="false" href="<?=$this->escapeHtmlAttr($this->recordLinker()->getUrl($this->driver)) ?>" data-images="<?=htmlspecialchars(json_encode($images ?? []), ENT_QUOTES, 'UTF-8');?>" data-settings="<?=htmlspecialchars(json_encode($settings ?? []), ENT_QUOTES, 'UTF-8');?>">
<a class="image-popup-trigger init" draggable="false" href="<?=$this->escapeHtmlAttr($this->recordLinker()->getUrl($this->driver)) ?>" data-images="<?=htmlspecialchars(json_encode($images ?? []), ENT_QUOTES, 'UTF-8');?>" data-settings="<?=htmlspecialchars(json_encode($settings ?? []), ENT_QUOTES, 'UTF-8');?>" tabindex="-1">
<div class="iconlabel format-<?=$this->record($this->driver)->getFormatClass(end($formats))?>"></div>
<div class="paginator-info"><span class="image-index"></span></div>
<img src="<?=$this->imageSrc()->getDataPixel()?>" data-src="<?=$this->url('cover-unavailable')?>" class="recordcover<?= ($images[0]['pdf'] ?? false) ? ' pdf-cover' : ''?>" alt="<?=$this->transEsc('No Cover Image')?>">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
<?php else: ?>
<?php $authors = $this->driver->tryMethod('getAuthorsWithRoles');
if (!empty($authors)): ?>
<div class="truncate-field" data-rows="1">
<div class="truncate-field" data-rows="1" tabindex="-1">
<?php foreach($authors as $index => $author): ?>
<?=($index > 0 ? '; ' : '')?><?=$this->record($this->driver)->getLinkedFieldElement('author', $author['name'], $author, ['date' => true, 'role' => true, 'authorityType' => $author['type'] ?? null])?>
<?php endforeach; ?>
Expand Down