feat: Sprint 3 — settings page with tabs/toggles/devices/danger-zone, brief page
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
document.addEventListener('alpine:init', () => {
|
||||
Alpine.data('switchToggle', (initial) => ({
|
||||
on: initial,
|
||||
toggle() {
|
||||
this.on = !this.on;
|
||||
this.$el.classList.toggle('active', this.on);
|
||||
this.$nextTick(() => {
|
||||
const hidden = this.$el.nextElementSibling;
|
||||
if (hidden) hidden.value = this.on ? 'on' : '';
|
||||
});
|
||||
}
|
||||
}));
|
||||
});
|
||||
Reference in New Issue
Block a user