ukhorsecremations.co.uk/assets/controllers/drawer_controller.js
Stewart Walter 08d696985a Site build
2026-05-01 12:28:23 +01:00

23 lines
492 B
JavaScript

import { Controller } from "@hotwired/stimulus"
import { useTransition } from "stimulus-use"
export default class Drawer extends Controller {
static targets = ["draw"]
connect() {
useTransition(this, {
element: this.drawTarget,
})
}
toggle() {
this.toggleTransition()
}
hide(event) {
if (!this.element.contains(event.target) && !this.menuTarget.classList.contains("hidden")) {
this.leave()
}
}
}