- manga import
- read from cbz
- save cbz from scrapping
- menu interactions
This commit is contained in:
Jérémy Guillot
2024-06-27 11:28:45 +02:00
parent d52b724df5
commit 115e4336ab
28 changed files with 1239 additions and 302 deletions

View File

@@ -1,12 +0,0 @@
// assets/controllers/menu_controller.js
import { Controller } from '@hotwired/stimulus';
export default class extends Controller {
static targets = ['menu'];
toggleMenu(event) {
this.menuTargets.forEach(menu => {
menu.classList.toggle('hidden', menu !== event.currentTarget);
});
}
}

View File

@@ -6,19 +6,30 @@ import {Controller} from '@hotwired/stimulus';
*/
/* stimulusFetch: 'lazy' */
export default class extends Controller {
static targets = ['body']
static targets = ["body", "toggleIcon"]
static values = { open: Boolean }
// ...
collapse(event) {
if (this.bodyTarget.style.display === "none") {
this.bodyTarget.style.display = "block";
event.currentTarget.classList.remove('fa-chevron-up');
event.currentTarget.classList.add('fa-chevron-down');
} else {
this.bodyTarget.style.display = "none";
event.currentTarget.classList.remove('fa-chevron-down');
event.currentTarget.classList.add('fa-chevron-up');
connect() {
if (!this.openValue) {
this.close()
}
}
toggle() {
if (this.bodyTarget.style.display === "none") {
this.open()
} else {
this.close()
}
}
open() {
this.bodyTarget.style.display = "block"
this.toggleIconTarget.classList.replace("fa-chevron-down", "fa-chevron-up")
}
close() {
this.bodyTarget.style.display = "none"
this.toggleIconTarget.classList.replace("fa-chevron-up", "fa-chevron-down")
}
}