git.99rst.org
/
flatnotes.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
| inline |
side by side
(parent:
8c2f831
)
Set document title to note title in note view
author
Adam Dullage
<redacted>
Fri, 3 May 2024 08:21:53 +0000
(09:21 +0100)
committer
Adam Dullage
<redacted>
Fri, 3 May 2024 08:21:53 +0000
(09:21 +0100)
client/router.js
patch
|
blob
|
history
diff --git
a/client/router.js
b/client/router.js
index 2d57e0296d2bf946ef879c66a3b4f79c4d8a6c78..073e65dcc1c1fa2d2598567674aa68e512fafcdb 100644
(file)
--- a/
client/router.js
+++ b/
client/router.js
@@
-33,4
+33,16
@@
const router = createRouter({
],
\r
});
\r
\r
+router.afterEach((to) => {
\r
+ let title = "flatnotes";
\r
+ if (to.name === "note") {
\r
+ if (to.params.title) {
\r
+ title = `${to.params.title} - ${title}`;
\r
+ } else {
\r
+ title = "New Note - " + title;
\r
+ }
\r
+ }
\r
+ document.title = title;
\r
+});
\r
+
\r
export default router;
\r
git clone https://git.99rst.org/PROJECT