From b80290ff38366dc3f671b3afe2a1bae2b494d6d5 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Sun, 16 Jul 2023 06:42:27 -0700 Subject: [PATCH] Fixes prettier JS complaints --- bookwyrm/static/js/bookwyrm.js | 18 +++++++++--------- bookwyrm/static/js/status_cache.js | 10 +++++----- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/bookwyrm/static/js/bookwyrm.js b/bookwyrm/static/js/bookwyrm.js index 0c6958f332..40fc34057b 100644 --- a/bookwyrm/static/js/bookwyrm.js +++ b/bookwyrm/static/js/bookwyrm.js @@ -49,7 +49,7 @@ let BookWyrm = new (class { document .querySelectorAll('form[name="register"]') .forEach((form) => - form.addEventListener("submit", (e) => this.setPreferredTimezone(e, form)) + form.addEventListener("submit", (e) => this.setPreferredTimezone(e, form)), ); } @@ -115,7 +115,7 @@ let BookWyrm = new (class { }); }, delay, - counter + counter, ); } @@ -193,8 +193,8 @@ let BookWyrm = new (class { .forEach((otherTrigger) => otherTrigger.setAttribute( "aria-pressed", - otherTrigger.getAttribute("aria-pressed") === "false" - ) + otherTrigger.getAttribute("aria-pressed") === "false", + ), ); // @todo Find a better way to handle the exception. @@ -328,8 +328,8 @@ let BookWyrm = new (class { bookwyrm.addRemoveClass( relatedForm, "is-hidden", - relatedForm.className.indexOf("is-hidden") == -1 - ) + relatedForm.className.indexOf("is-hidden") == -1, + ), ); this.ajaxPost(form).catch((error) => { @@ -603,7 +603,7 @@ let BookWyrm = new (class { "select:not([disabled])", "details:not([disabled])", '[tabindex]:not([tabindex="-1"]):not([disabled])', - ].join(",") + ].join(","), ); const firstFocusableEl = focusableEls[0]; const lastFocusableEl = focusableEls[focusableEls.length - 1]; @@ -708,7 +708,7 @@ let BookWyrm = new (class { toggleStatus("scanning"); Quagga.start(); - } + }, ); } @@ -731,7 +731,7 @@ let BookWyrm = new (class { 0, 0, parseInt(drawingCanvas.getAttribute("width")), - parseInt(drawingCanvas.getAttribute("height")) + parseInt(drawingCanvas.getAttribute("height")), ); result.boxes .filter((box) => box !== result.box) diff --git a/bookwyrm/static/js/status_cache.js b/bookwyrm/static/js/status_cache.js index 0a9f3abc5f..4b83cc4485 100644 --- a/bookwyrm/static/js/status_cache.js +++ b/bookwyrm/static/js/status_cache.js @@ -120,7 +120,7 @@ let StatusCache = new (class { copy.remove(); }, 10000, - copy + copy, ); } @@ -136,7 +136,7 @@ let StatusCache = new (class { // Clear localstorage form.querySelectorAll("[data-cache-draft]").forEach((node) => - window.localStorage.removeItem(node.dataset.cacheDraft) + window.localStorage.removeItem(node.dataset.cacheDraft), ); // Close modals @@ -150,7 +150,7 @@ let StatusCache = new (class { document .querySelectorAll("[data-shelve-button-book='" + form.book.value + "']") .forEach((button) => - this.cycleShelveButtons(button, form.reading_status.value) + this.cycleShelveButtons(button, form.reading_status.value), ); } @@ -208,11 +208,11 @@ let StatusCache = new (class { // Disable the current state button.querySelector( - "[data-shelf-dropdown-identifier=" + identifier + "] button" + "[data-shelf-dropdown-identifier=" + identifier + "] button", ).disabled = true; let main_button = button.querySelector( - "[data-shelf-dropdown-identifier=" + next_identifier + "]" + "[data-shelf-dropdown-identifier=" + next_identifier + "]", ); // Hide the option that's shown as the main button