Added stimulus and turbo. Added first controller to close sidebar.

This commit is contained in:
Krzysztof Płaczek
2024-10-18 17:53:53 +02:00
parent 471baaf562
commit d2d2de4b85
12 changed files with 254 additions and 5 deletions

View File

@@ -0,0 +1,15 @@
import { Controller } from '@hotwired/stimulus';
export default class extends Controller {
async close(){
this.element.style.width = '0';
await this.#waitForAnimation();
this.element.remove();
}
#waitForAnimation() {
return Promise.all(
this.element.getAnimations().map((animation) => animation.finished),
);
}
}