mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-22 22:46:22 +00:00
17 lines
376 B
JavaScript
17 lines
376 B
JavaScript
import { Controller } from "stimulus";
|
|
|
|
export default class extends Controller {
|
|
static targets = [];
|
|
|
|
connect() {
|
|
const state = window.sessionStorage.getItem(this.element.id);
|
|
|
|
if (state === "open") {
|
|
this.element.setAttribute("open", true);
|
|
}
|
|
}
|
|
|
|
store(event = undefined) {
|
|
window.sessionStorage.setItem(this.element.id, event.newState);
|
|
}
|
|
}
|