Skip to content

Commit 35860d1

Browse files
authored
Merge pull request #196 from FriendsOfREDAXO/media_live_search
svg fix
2 parents 0a2d996 + b9ec34f commit 35860d1

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

assets/media-live-search.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,13 @@
131131
object-fit: cover;
132132
}
133133

134+
/* Inline SVG in thumbnail should scale to fit */
135+
.qn-live-search-thumb svg {
136+
width: 100%;
137+
height: 100%;
138+
display: block;
139+
}
140+
134141
.qn-live-search-thumb i {
135142
font-size: 16px;
136143
color: #6c757d;

assets/media-live-search.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,9 @@ function initQuickNavigationMediaLiveSearch() {
137137

138138
if (item.thumbnail.type === 'image') {
139139
thumbnail = '<img src="' + item.thumbnail.src + '" alt="' + item.thumbnail.alt + '" loading="lazy">';
140+
} else if (item.thumbnail.type === 'svg') {
141+
// inline SVG markup - already sanitized server-side
142+
thumbnail = item.thumbnail.svg;
140143
} else if (item.thumbnail.type === 'icon') {
141144
thumbnail = '<i class="' + item.thumbnail.icon + '" title="' + item.thumbnail.title + '"></i>';
142145
} else if (item.thumbnail.type === 'error') {

0 commit comments

Comments
 (0)