From fa22244709c21604ed87f993843939edf14d05b0 Mon Sep 17 00:00:00 2001 From: luxick Date: Mon, 22 Jun 2026 17:25:11 +0200 Subject: [PATCH] Use companion for diary photos --- assets/companion.js | 7 ++++--- assets/diary/content.html | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/assets/companion.js b/assets/companion.js index 0bf29d3..d1f383e 100644 --- a/assets/companion.js +++ b/assets/companion.js @@ -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). diff --git a/assets/diary/content.html b/assets/diary/content.html index 7d195d1..14759da 100644 --- a/assets/diary/content.html +++ b/assets/diary/content.html @@ -6,7 +6,7 @@ {{if .Photos}}
{{range .Photos}} - + {{end}}
{{end}}