From 95002a34ade69451beeca1d7cd2fddd001d52e33 Mon Sep 17 00:00:00 2001 From: luxick Date: Sun, 4 Oct 2026 15:34:47 +0200 Subject: [PATCH] Minor canvas improvements --- assets/canvas/main.html | 2 +- assets/companion.js | 2 ++ assets/style.css | 2 -- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/assets/canvas/main.html b/assets/canvas/main.html index 60e8d10..0854746 100644 --- a/assets/canvas/main.html +++ b/assets/canvas/main.html @@ -14,7 +14,7 @@ navigation and canvas.js can save on pagehide. */}} {{define "shell"}}
- {{.PageURL}}{{.Name}} + {{.Title}} {{if not .Error}} diff --git a/assets/companion.js b/assets/companion.js index 005f713..fc61c10 100644 --- a/assets/companion.js +++ b/assets/companion.js @@ -132,6 +132,8 @@ // Folders end with "/" — let the browser navigate normally. var path = (item && item.dataset.path) || anchor.getAttribute('href'); if (!path || path.endsWith('/')) return; + // Canvases open in the wiki's own canvas view. + if (/\.canvas$/i.test(path.split(/[?#]/)[0])) return; // Allow modified clicks (open in new tab, etc.) to pass through. if (e.button !== 0 || e.metaKey || e.ctrlKey || e.shiftKey || e.altKey) return; var rel = wikiPathFromHref(path); diff --git a/assets/style.css b/assets/style.css index 1e20465..e20256d 100644 --- a/assets/style.css +++ b/assets/style.css @@ -960,8 +960,6 @@ label.tree-name { flex: 1; cursor: pointer; position: relative; } font-size: var(--font-sm); } .canvas-title { min-width: 0; max-width: 30rem; } -.canvas-title a { color: var(--link); } -.canvas-title a:hover { color: var(--link-hover); } .canvas-tools { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1); } .canvas-status { margin-left: auto; } .canvas-status.is-error { color: var(--danger); }