Fix Alpine.js _wsInitData global access in workspace template
This commit is contained in:
@@ -336,9 +336,9 @@
|
||||
.preview-leave-end{transform:translateX(100%);opacity:0;}
|
||||
</style>
|
||||
|
||||
<script>console.log('FLOWDECK v2.4.6 — ws-split about to render, _wsInitData exists:', typeof _wsInitData !== 'undefined');</script>
|
||||
<script>console.log('FLOWDECK v2.4.6 — ws-split about to render, _wsInitData exists:', typeof window._wsInitData !== 'undefined');</script>
|
||||
|
||||
<div class="ws-split" x-data="_wsInitData"
|
||||
<div class="ws-split" x-data="window._wsInitData"
|
||||
@dragover.prevent="onDragOver($event)"
|
||||
@dragleave="onDragLeave($event)"
|
||||
@drop.prevent="onDrop($event)"
|
||||
@@ -499,7 +499,7 @@
|
||||
<span class="icon" x-text="_fileIcon(node.name, node.is_folder, node.content_format)"></span>
|
||||
|
||||
<template x-if="node.is_folder">
|
||||
<span class="name folder" @click.stop="navigateToFolder(node.id)"
|
||||
<span class="name folder" @click.stop="navigateToFolder(node.id)"
|
||||
@dblclick.prevent.stop="startInlineRename(node, $event)">
|
||||
<span x-show="renamingId !== node.id" x-text="node.name"></span>
|
||||
<span class="child-count" x-show="node.child_count > 0 && renamingId !== node.id"
|
||||
@@ -592,7 +592,7 @@
|
||||
</template>
|
||||
<button class="tag-add-btn" @click.stop="startTagInput(node)" title="Add tag">+</button>
|
||||
<span x-show="tagInputId === node.id" style="display:contents;">
|
||||
<input class="tag-input" x-ref="tagInputEl"
|
||||
<input class="tag-input" x-ref="tagInputEl"
|
||||
@keydown.enter="addTag(node.id, $event.target.value), $event.target.value=''"
|
||||
@keydown.escape="tagInputId=null"
|
||||
@blur="tagInputId=null"
|
||||
@@ -813,7 +813,7 @@
|
||||
<div x-show="ctxTagAdding" style="padding:6px 10px;background:var(--bg-tertiary);border-radius:6px;margin:2px 6px;">
|
||||
<div style="display:grid;grid-template-columns:repeat(7,1fr);gap:4px;margin-bottom:6px;">
|
||||
<template x-for="c in ctxTagColors" :key="c">
|
||||
<div class="color-swatch-ctx" :class="{ selected: ctxNewTagColor === c }"
|
||||
<div class="color-swatch-ctx" :class="{ selected: ctxNewTagColor === c }"
|
||||
:style="{background: c}" @click.stop="ctxNewTagColor=c"></div>
|
||||
</template>
|
||||
</div>
|
||||
@@ -832,7 +832,7 @@
|
||||
</div>
|
||||
|
||||
<!-- Preview tooltip -->
|
||||
<div class="file-preview" x-show="previewVisible"
|
||||
<div class="file-preview" x-show="previewVisible"
|
||||
:style="{ left: previewX + 'px', top: previewY + 'px' }"
|
||||
@mouseenter="previewVisible = true" @mouseleave="previewVisible = false">
|
||||
<div class="file-preview-header" x-text="previewName"></div>
|
||||
@@ -870,7 +870,7 @@
|
||||
|
||||
<script>
|
||||
console.log('FLOWDECK v2.4.6 — IIFE running, about to set _wsInitData');
|
||||
var _wsInitData = (function() {
|
||||
window._wsInitData = (function() {
|
||||
return {
|
||||
tree:[],
|
||||
displayTree:[],
|
||||
@@ -944,7 +944,7 @@ var _wsInitData = (function() {
|
||||
uploadStartTime: 0,
|
||||
|
||||
// Path bar
|
||||
get pathValue() {
|
||||
get pathValue() {
|
||||
return '/workspace/' + this.folderStack.filter(function(b){return b.id > 0}).map(function(b){return b.name}).join('/');
|
||||
},
|
||||
|
||||
@@ -1440,7 +1440,7 @@ var _wsInitData = (function() {
|
||||
|
||||
// ── Event delegation for renderChildren action buttons ──
|
||||
handleTreeAction(ev) {
|
||||
var btn = (ev.target.closest && ev.target.closest('[data-ws-action]'))
|
||||
var btn = (ev.target.closest && ev.target.closest('[data-ws-action]'))
|
||||
|| (ev.target.parentElement && ev.target.parentElement.closest('[data-ws-action]'));
|
||||
if (!btn) return;
|
||||
ev.stopPropagation();
|
||||
@@ -2387,12 +2387,12 @@ var _wsInitData = (function() {
|
||||
} else {
|
||||
for (var k in this.selectedIds) delete this.selectedIds[k];
|
||||
}
|
||||
this.selectedIds = Object.assign({}, this.selectedIds);
|
||||
this.selectedIds = Object.assign({}, this.selectedIds);
|
||||
this.selectedIdsCount = Object.keys(this.selectedIds).length;
|
||||
}
|
||||
|
||||
};
|
||||
})();
|
||||
console.log('FLOWDECK v2.4.6 — IIFE done, _wsInitData keys:', Object.keys(_wsInitData).length);
|
||||
console.log('FLOWDECK v2.4.6 — IIFE done, _wsInitData keys:', Object.keys(window._wsInitData).length);
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user