Skip to content

Commit

Permalink
Fixes prettier JS complaints
Browse files Browse the repository at this point in the history
  • Loading branch information
mouse-reeve committed Jul 16, 2023
1 parent 61037cf commit b80290f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
18 changes: 9 additions & 9 deletions bookwyrm/static/js/bookwyrm.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)),
);
}

Expand Down Expand Up @@ -115,7 +115,7 @@ let BookWyrm = new (class {
});
},
delay,
counter
counter,
);
}

Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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) => {
Expand Down Expand Up @@ -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];
Expand Down Expand Up @@ -708,7 +708,7 @@ let BookWyrm = new (class {

toggleStatus("scanning");
Quagga.start();
}
},
);
}

Expand All @@ -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)
Expand Down
10 changes: 5 additions & 5 deletions bookwyrm/static/js/status_cache.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ let StatusCache = new (class {
copy.remove();
},
10000,
copy
copy,
);
}

Expand All @@ -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
Expand All @@ -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),
);
}

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit b80290f

Please sign in to comment.