20 lines
577 B
TypeScript
20 lines
577 B
TypeScript
import {Controller} from '@hotwired/stimulus';
|
|
|
|
export default class extends Controller {
|
|
static targets: Array<string> = ['container'];
|
|
declare readonly containerTarget: HTMLElement;
|
|
|
|
connect(): void {
|
|
console.log('Init Burgers');
|
|
this.containerTarget.style.left = '';
|
|
this.containerTarget.style.right = `-${this.containerTarget.offsetWidth}px`;
|
|
}
|
|
|
|
open(): void {
|
|
this.containerTarget.style.right = '0';
|
|
}
|
|
|
|
close(): void {
|
|
this.containerTarget.style.right = `-${this.containerTarget.offsetWidth}px`;
|
|
}
|
|
}
|