Skip to content

Commit 7a1657a

Browse files
committed
Merge branch 'release-11.0' into dev
2 parents df0cab3 + 6b47b74 commit 7a1657a

File tree

4 files changed

+21
-4
lines changed

4 files changed

+21
-4
lines changed

module/VuFind/tests/integration-tests/src/VuFindTest/Mink/RecordCoverImageTest.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,19 @@ public function testCoverLoading(
181181
}
182182

183183
// Confirm the expected status of the image (most importantly, should it be visible or hidden?):
184+
$coverContainer = $this->findCss($page, '.record-cover-container');
185+
if ($noCoverAvailableImage) {
186+
$this->assertStringNotContainsString(
187+
'hidden',
188+
$coverContainer?->getAttribute('class') ?? ''
189+
);
190+
} else {
191+
$this->assertStringContainsString(
192+
'hidden',
193+
$coverContainer?->getAttribute('class') ?? ''
194+
);
195+
}
196+
184197
$expectedClasses = 'recordcover'
185198
. ($ajaxcovers ? ' ajax' : '')
186199
. (empty($noCoverAvailableImage) ? ' hidden' : '');

themes/bootstrap5/js/covers.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,10 @@ VuFind.register('covers', function covers() {
100100
function checkImgSize(img) {
101101
if (img.getBoundingClientRect().width < 2) {
102102
img.classList.add('hidden');
103+
let recordCoverContainer = img.closest('.record-cover-container');
104+
if (recordCoverContainer !== null) {
105+
recordCoverContainer.classList.add('hidden');
106+
}
103107
}
104108
img.dataset.loaded = 'true';
105109
}

themes/bootstrap5/templates/RecordDriver/DefaultRecord/cover.phtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
// Determine link attributes; use legacy $this->link property as a fallback for backward compatibility.
33
$linkAttributes = $this->linkAttributes ?? ($this->link ? ['href' => $this->link] : []);
44
if ($linkAttributes && !isset($linkAttributes['class'])) {
5-
$linkAttributes['class'] = 'record-cover-link';
5+
$linkAttributes['class'] = 'record-cover-container record-cover-link';
66
}
77
?>
88
<?php if ($linkAttributes): ?>
99
<a<?=$this->htmlAttributes($linkAttributes)?>>
1010
<?php else: ?>
11-
<div aria-hidden="true">
11+
<div class="record-cover-container" aria-hidden="true">
1212
<?php endif; ?>
1313
<?php /* Display thumbnail if appropriate: */ ?>
1414
<?php if ($cover): ?>

themes/bootstrap5/templates/RecordDriver/EDS/cover.phtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
$includeLinkInMarkup = $this->link && $cover !== false;
44
?>
55
<?php if ($includeLinkInMarkup): ?>
6-
<a href="<?=$this->escapeHtmlAttr($this->link)?>" class="record-cover-link">
6+
<a href="<?=$this->escapeHtmlAttr($this->link)?>" class="record-cover-container record-cover-link">
77
<?php else: ?>
8-
<div aria-hidden="true">
8+
<div class="record-cover-container" aria-hidden="true">
99
<?php endif; ?>
1010
<?php /* Display thumbnail if appropriate: */ ?>
1111
<?php if ($cover): ?>

0 commit comments

Comments
 (0)