diff options
| author | erdgeist <erdgeist@erdgeist.org> | 2026-07-21 14:24:59 +0200 |
|---|---|---|
| committer | erdgeist <erdgeist@erdgeist.org> | 2026-07-21 14:24:59 +0200 |
| commit | c14683fe37fabe06082f43e8bf67debc4cca7297 (patch) | |
| tree | 10054588f053cf071a55df067180091d3388e05a /app/views/nodes | |
| parent | 1912b8fbf0e1e1ea84a89c033e20e34235d19cce (diff) | |
Render asset credit inside the gallery lightbox correctly
GLightbox's own selector-based description feature never actually
resolved a selector in three different attempts -- literal text,
then a resolved-but-empty div, then apparently not firing at all
against the installed (unversioned) build. Replaced with a small
afterSlideLoad handler that reads a plain data-credit-selector
attribute and copies the real element's HTML into the slide's
description area directly, depending only on GLightbox handing back
a real DOM node per slide -- a much smaller contract than trusting
its own caption-resolution feature.
Renamed the credit div's class from glightbox-desc, since that name
is reserved by the library's own bundled CSS (display: none
!important) and can't be reliably overridden from here.
Also: distinguishes the credit line and the "N Bilder" caption from
ordinary body text (italic, muted, matching .author_and_date's
existing convention), and makes the lightbox's caption card follow
the site's light/dark toggle via Canvas/CanvasText, since the
library's bundled theme never adapts to it on its own.
Diffstat (limited to 'app/views/nodes')
| -rw-r--r-- | app/views/nodes/edit.html.erb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/app/views/nodes/edit.html.erb b/app/views/nodes/edit.html.erb index da682f09..07b42d48 100644 --- a/app/views/nodes/edit.html.erb +++ b/app/views/nodes/edit.html.erb | |||
| @@ -86,6 +86,7 @@ | |||
| 86 | data-large-url="<%= related.asset.upload.url(:large) %>" | 86 | data-large-url="<%= related.asset.upload.url(:large) %>" |
| 87 | data-original-url="<%= related.asset.upload.url %>" | 87 | data-original-url="<%= related.asset.upload.url %>" |
| 88 | data-name="<%= related.asset.name %>" | 88 | data-name="<%= related.asset.name %>" |
| 89 | data-has-credit="<%= related.asset.has_credit? %>" | ||
| 89 | data-headline="<%= related.headline? %>" | 90 | data-headline="<%= related.headline? %>" |
| 90 | class="<%= "is_headline" if related.headline? %>"> | 91 | class="<%= "is_headline" if related.headline? %>"> |
| 91 | <span class="related_asset_handle"><%= icon("grip-vertical", library: "tabler", "aria-hidden": true) %></span> | 92 | <span class="related_asset_handle"><%= icon("grip-vertical", library: "tabler", "aria-hidden": true) %></span> |
