From 1c0ccfc6bf5992e4f1ab8344ea3aa957f3c3cb9c Mon Sep 17 00:00:00 2001 From: Arzumify Date: Tue, 2 Jul 2024 18:23:52 +0100 Subject: [PATCH] Fixed handleGesture by moving it up --- static/js/main.js | 52 +++++++++++++++++++++++------------------------ 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/static/js/main.js b/static/js/main.js index 0ff89ae..22dd0d9 100644 --- a/static/js/main.js +++ b/static/js/main.js @@ -84,6 +84,32 @@ 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") @@ -122,32 +148,6 @@ document.addEventListener("DOMContentLoaded", function() { }, 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") - } - } - noteBox.innerText = "" noteBox.readOnly = true