Skip to content

Commit 312c85a

Browse files
committed
docs: Update documentation
1 parent f5e0210 commit 312c85a

32 files changed

+12342
-22
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/**
2+
* Fetch note with given ID from backend
3+
*
4+
* @param noteId of the given note to be fetched. If false, fetches current note.
5+
*/
6+
async function fetchNote(noteId = null) {
7+
if (!noteId) {
8+
noteId = document.body.getAttribute("data-note-id");
9+
}
10+
11+
const resp = await fetch(`api/notes/${noteId}`);
12+
13+
return await resp.json();
14+
}
15+
16+
document.addEventListener('DOMContentLoaded', () => {
17+
const toggleMenuButton = document.getElementById('toggleMenuButton');
18+
const layout = document.getElementById('layout');
19+
20+
if (toggleMenuButton && layout) {
21+
toggleMenuButton.addEventListener('click', () => layout.classList.toggle('showMenu'));
22+
}
23+
}, false);

0 commit comments

Comments
 (0)