5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-22 15:16:21 +00:00
panel/app/javascript/controllers/details_controller.js
2024-07-20 15:21:03 -03:00

17 lines
386 B
JavaScript

import { Controller } from "@hotwired/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);
}
}