From 95055cc857e16cc587698fae9992f79e5a82f795 Mon Sep 17 00:00:00 2001 From: Arzumify Date: Tue, 2 Jul 2024 18:25:23 +0100 Subject: [PATCH] Fixed handleGesture by moving it up, actually this time --- static/js/main.js | 53 ++++++++++++++++++++++++----------------------- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/static/js/main.js b/static/js/main.js index 22dd0d9..1c9af90 100644 --- a/static/js/main.js +++ b/static/js/main.js @@ -68,6 +68,33 @@ let indiv = false let mobile = false let selectLatestNote = false + +function handleGesture() { + if (indiv) { + indiv = false + notesBar.style.width = "100%"; + noteBoxDiv.style.width = "0px" + if (selectedNote !== 0) { + noteBoxDiv.readOnly = true + } + notesDiv.classList.remove("hidden") + noteBoxDiv.classList.add("hidden") + backButton.classList.add("hidden") + newNote.classList.remove("hidden") + } else { + indiv = true + noteBoxDiv.style.width = "100%"; + notesBar.style.width = "0px" + if (selectedNote !== 0) { + noteBoxDiv.readOnly = false + } + notesDiv.classList.add("hidden") + noteBoxDiv.classList.remove("hidden") + backButton.classList.remove("hidden") + newNote.classList.add("hidden") + } +} + // Init the note box document.addEventListener("DOMContentLoaded", function() { pell.init({ @@ -84,32 +111,6 @@ document.addEventListener("DOMContentLoaded", function() { }) let noteBox = document.getElementsByClassName("pell-content")[0] - function handleGesture() { - if (indiv) { - indiv = false - notesBar.style.width = "100%"; - noteBoxDiv.style.width = "0px" - if (selectedNote !== 0) { - noteBoxDiv.readOnly = true - } - notesDiv.classList.remove("hidden") - noteBoxDiv.classList.add("hidden") - backButton.classList.add("hidden") - newNote.classList.remove("hidden") - } else { - indiv = true - noteBoxDiv.style.width = "100%"; - notesBar.style.width = "0px" - if (selectedNote !== 0) { - noteBoxDiv.readOnly = false - } - notesDiv.classList.add("hidden") - noteBoxDiv.classList.remove("hidden") - backButton.classList.remove("hidden") - newNote.classList.add("hidden") - } - } - if (/Android|iPhone|iPod/i.test(navigator.userAgent)) { mobile = true noteBoxDiv.classList.add("mobile")