fix: contexte menu — window._wsData global + exposé avant await
- @contextmenu.prevent passe par window._wsData (global) au lieu du scope Alpine → contourne tout problème de résolution de scope Alpine - window._wsData = this déplacé AVANT le await fetch(...) dans init() → disponible immédiatement, pas après la réponse API - Conserve @click.self pour fermer le menu en cliquant sur le fond
This commit is contained in:
+1
-1
@@ -39,7 +39,7 @@ async def lifespan(_app: FastAPI):
|
|||||||
|
|
||||||
app = FastAPI(
|
app = FastAPI(
|
||||||
title="FlowDeck",
|
title="FlowDeck",
|
||||||
version="2.4.4",
|
version="2.4.5",
|
||||||
docs_url="/docs" if settings.log_level == "DEBUG" else None,
|
docs_url="/docs" if settings.log_level == "DEBUG" else None,
|
||||||
redoc_url=None,
|
redoc_url=None,
|
||||||
lifespan=lifespan,
|
lifespan=lifespan,
|
||||||
|
|||||||
@@ -341,7 +341,7 @@
|
|||||||
@dragleave="onDragLeave($event)"
|
@dragleave="onDragLeave($event)"
|
||||||
@drop.prevent="onDrop($event)"
|
@drop.prevent="onDrop($event)"
|
||||||
@keydown="onKeydown($event)"
|
@keydown="onKeydown($event)"
|
||||||
@contextmenu.prevent="onContextMenu($event)"
|
@contextmenu.prevent="if(window._wsData) window._wsData.onContextMenu($event)"
|
||||||
@click.self="ctxMenu.visible = false"
|
@click.self="ctxMenu.visible = false"
|
||||||
tabindex="0"
|
tabindex="0"
|
||||||
x-ref="layout">
|
x-ref="layout">
|
||||||
@@ -1005,6 +1005,8 @@ document.addEventListener('alpine:init', function() {
|
|||||||
|
|
||||||
async init() {
|
async init() {
|
||||||
try {
|
try {
|
||||||
|
// Expose globally for event handlers (BEFORE await)
|
||||||
|
window._wsData = this;
|
||||||
var url = '/api/local-workspace/tree';
|
var url = '/api/local-workspace/tree';
|
||||||
if (this.currentFolder && this.currentFolder > 0) {
|
if (this.currentFolder && this.currentFolder > 0) {
|
||||||
url += '?folder=' + this.currentFolder;
|
url += '?folder=' + this.currentFolder;
|
||||||
|
|||||||
Reference in New Issue
Block a user