Use companion for diary photos
This commit is contained in:
+4
-3
@@ -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).
|
||||
|
||||
@@ -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}}
|
||||
|
||||
Reference in New Issue
Block a user