[build] upgrade eslint to 9.37.0 (#88)
Co-authored-by: tobi <tobi.smethurst@protonmail.com> Reviewed-on: https://codeberg.org/superseriousbusiness/masto-fe-standalone/pulls/88 Co-authored-by: Zoë Bijl <moiety@noreply.codeberg.org> Co-committed-by: Zoë Bijl <moiety@noreply.codeberg.org>
This commit is contained in:
@@ -1,33 +1,33 @@
|
||||
import 'packs/public-path';
|
||||
import Rails from '@rails/ujs';
|
||||
import "packs/public-path";
|
||||
import Rails from "@rails/ujs";
|
||||
|
||||
import loadKeyboardExtensions from 'flavours/glitch/load_keyboard_extensions';
|
||||
import { loadPolyfills } from 'flavours/glitch/polyfills';
|
||||
import 'cocoon-js-vanilla';
|
||||
import loadKeyboardExtensions from "flavours/glitch/load_keyboard_extensions";
|
||||
import { loadPolyfills } from "flavours/glitch/polyfills";
|
||||
import "cocoon-js-vanilla";
|
||||
|
||||
function main() {
|
||||
const toggleSidebar = () => {
|
||||
const sidebar = document.querySelector('.sidebar ul');
|
||||
const toggleButton = document.querySelector('.sidebar__toggle__icon');
|
||||
const sidebar = document.querySelector(".sidebar ul");
|
||||
const toggleButton = document.querySelector(".sidebar__toggle__icon");
|
||||
|
||||
if (sidebar.classList.contains('visible')) {
|
||||
if (sidebar.classList.contains("visible")) {
|
||||
document.body.style.overflow = null;
|
||||
toggleButton.setAttribute('aria-expanded', 'false');
|
||||
toggleButton.setAttribute("aria-expanded", "false");
|
||||
} else {
|
||||
document.body.style.overflow = 'hidden';
|
||||
toggleButton.setAttribute('aria-expanded', 'true');
|
||||
document.body.style.overflow = "hidden";
|
||||
toggleButton.setAttribute("aria-expanded", "true");
|
||||
}
|
||||
|
||||
toggleButton.classList.toggle('active');
|
||||
sidebar.classList.toggle('visible');
|
||||
toggleButton.classList.toggle("active");
|
||||
sidebar.classList.toggle("visible");
|
||||
};
|
||||
|
||||
Rails.delegate(document, '.sidebar__toggle__icon', 'click', () => {
|
||||
Rails.delegate(document, ".sidebar__toggle__icon", "click", () => {
|
||||
toggleSidebar();
|
||||
});
|
||||
|
||||
Rails.delegate(document, '.sidebar__toggle__icon', 'keydown', e => {
|
||||
if (e.key === ' ' || e.key === 'Enter') {
|
||||
Rails.delegate(document, ".sidebar__toggle__icon", "keydown", e => {
|
||||
if (e.key === " " || e.key === "Enter") {
|
||||
e.preventDefault();
|
||||
toggleSidebar();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user