5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-22 19:06:20 +00:00
panel/app/javascript/controllers/details_controller.js

18 lines
376 B
JavaScript
Raw Normal View History

2024-02-29 19:27:48 +00:00
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);
}
}