Use companion for diary photos

This commit is contained in:
2026-06-22 17:25:11 +02:00
parent d92c2f008d
commit fa22244709
2 changed files with 5 additions and 4 deletions
+4 -3
View File
@@ -116,11 +116,12 @@
if (!state.available) return;
document.addEventListener('click', function (e) {
if (!e.target.closest) return;
// Match both listing styles: table rows expose the file link inside
// a .list-item row; thumbnail tiles are bare a.thumb-tile anchors.
// Match every listing style: table rows expose the file link inside
// a .list-item row; thumbnail tiles are bare a.thumb-tile anchors;
// diary photo grids wrap each thumbnail in a .photo-grid anchor.
// The left tree rail's file anchors (a.tree-file) join in too;
// folder anchors there end in "/" and fall through to navigation.
var anchor = e.target.closest('.list-item a, a.thumb-tile, aside.tree-sidebar a.tree-file');
var anchor = e.target.closest('.list-item a, a.thumb-tile, .photo-grid a, aside.tree-sidebar a.tree-file');
if (!anchor) return;
var item = anchor.closest('.list-item');
// Only intercept the primary file link, and only for files (not folders).
+1 -1
View File
@@ -6,7 +6,7 @@
{{if .Photos}}
<div class="photo-grid">
{{range .Photos}}
<a href="{{.URL}}" target="_blank"><img src="{{.ThumbURL}}" alt="" loading="lazy"></a>
<a href="{{.URL}}"><img src="{{.ThumbURL}}" alt="" loading="lazy"></a>
{{end}}
</div>
{{end}}