From 5ecb603e86f1f15a0ff4e6635bb8e18725a2fbaf Mon Sep 17 00:00:00 2001 From: zadam Date: Sat, 1 Jan 2022 22:32:38 +0100 Subject: [PATCH] sharing fixes --- src/public/app/share.js | 4 ++-- src/views/share/page.ejs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/public/app/share.js b/src/public/app/share.js index e7785ba7a..2f2621e2a 100644 --- a/src/public/app/share.js +++ b/src/public/app/share.js @@ -5,10 +5,10 @@ */ async function fetchNote(noteId = null) { if (!noteId) { - noteId = document.getElementsByName("body")[0].getAttribute("data-note-id"); + noteId = document.body.getAttribute("data-note-id"); } - const resp = await fetch(`share/api/notes/${noteId}`); + const resp = await fetch(`api/notes/${noteId}`); return await resp.json(); } diff --git a/src/views/share/page.ejs b/src/views/share/page.ejs index c889bd7f3..0f1ccaa1b 100644 --- a/src/views/share/page.ejs +++ b/src/views/share/page.ejs @@ -7,7 +7,7 @@ <% } else { %> <% } %> - + <% if (!note.hasLabel("shareOmitDefaultCss")) { %> @@ -19,7 +19,7 @@ <% } %> <% for (const jsRelation of note.getRelations("shareJs")) { %> - + <% } %> <%- header %> <%= note.title %>