Adding mobile support for sidebar

This commit is contained in:
Ronan Berder
2025-05-02 22:43:40 +08:00
parent 7c13727903
commit 9b5f054bb2
9 changed files with 631 additions and 554 deletions
+1 -1
View File
@@ -39,7 +39,7 @@ window.basecoat.registerDialog = function(Alpine) {
$main: {
'@dialog:open.window'(e) { if (e.detail && e.detail.id === this.id) this.show() },
'@dialog:close.window'(e) { if (e.detail && e.detail.id === this.id) this.hide() },
'@keydown.escape.window'() { this.open && this.hide(); },
'@keydown.escape.window'() { this.open && this.hide() },
},
$trigger: {
'@click'() { this.show() },
+2 -6
View File
@@ -14,12 +14,8 @@ window.basecoat.registerSidebar= function(Alpine) {
$main: {
'@sidebar:open.window'(e) { if (!this.id || (e.detail && e.detail.id === this.id)) this.open = true },
'@sidebar:close.window'(e) { if (!this.id || (e.detail && e.detail.id === this.id)) this.open = false },
'@sidebar:toggle.window'(e) {
if (!this.id || (e.detail && e.detail.id === this.id)) {
this.open = !this.open;
console.log('toggle', e);
}
},
'@sidebar:toggle.window'(e) { if (!this.id || (e.detail && e.detail.id === this.id)) this.open = !this.open },
'@click'(e) { if (e.target === this.$el) this.open = false },
':aria-hidden'() { return !this.open },
':inert'() { return !this.open },
},