local-workspace: reposition Open button to right of title, fix hover visibility
- Add CSS rule .ws-tree-item:hover .hover-only for tree item hover visibility - Move OPEN button OUT of .actions div, place it right after title span with margin-left:auto and .hover-only class (matches Library layout exactly) - Fix renderChildren() static HTML: button now between name span and .actions - Remove duplicate button from inside .actions div - Button calls selectForPreview(node) or openSidePeek(id) for side preview panel
This commit is contained in:
@@ -90,6 +90,7 @@
|
||||
/* ── Hover-only elements ── */
|
||||
.hover-only{opacity:0;transition:opacity 0.12s;flex-shrink:0;}
|
||||
.ws-row:hover .hover-only,.ws-row.selected .hover-only{opacity:1;}
|
||||
.ws-tree-item:hover .hover-only,.ws-tree-item.selected .hover-only{opacity:1;}
|
||||
|
||||
/* ── Drag handle ── */
|
||||
.drag-handle{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;cursor:grab;flex-shrink:0;margin-right:2px;}
|
||||
@@ -1113,6 +1114,12 @@ window._wsInitData = (function() {
|
||||
+ ' onclick="event.stopPropagation()">'
|
||||
+ '</span>';
|
||||
}
|
||||
// Open button for files — to the right of title (like Library)
|
||||
if (!c.is_folder) {
|
||||
html += '<a href="#" class="btn-open hover-only" style="margin-left:auto;"'
|
||||
+ ' onclick="event.stopPropagation();event.preventDefault();var d=window._wsData;if(d)d.openSidePeek('+escId+')"'
|
||||
+ ' title="Open in side preview">↢ Open</a>';
|
||||
}
|
||||
html += '<div class="actions">';
|
||||
if (c.is_folder) {
|
||||
html += '<span style="display:flex;gap:2px">';
|
||||
@@ -1123,12 +1130,6 @@ window._wsInitData = (function() {
|
||||
}
|
||||
html += '<button class="ws-act" data-ws-action="rename" data-ws-id="'+escId+'" data-ws-name="'+escName+'" title="Rename">'+getSvgIcon('edit',14)+'</button>';
|
||||
html += '<button class="ws-act danger" data-ws-action="delete" data-ws-id="'+escId+'" data-ws-name="'+escName+'" title="Delete">'+getSvgIcon('trash',14)+'</button>';
|
||||
// Open button for files — opens in side preview panel (like Library)
|
||||
if (!c.is_folder) {
|
||||
html += '<a href="#" class="btn-open hover-only" style="display:inline-flex;align-items:center;gap:4px;padding:3px 10px;border:1px solid var(--border);border-radius:4px;font-size:12px;color:var(--text-secondary);background:var(--bg-tertiary);cursor:pointer;text-decoration:none;margin-left:auto;"'
|
||||
+ ' onclick="event.stopPropagation();event.preventDefault();var d=window._wsData;if(d)d.openSidePeek('+escId+')"\n'
|
||||
+ ' title="Open in side preview">\u21e2 Open</a>';
|
||||
}
|
||||
// Tags
|
||||
if (c.tags && c.tags.length > 0) {
|
||||
html += '<span style="display:flex;gap:2px;margin-left:4px;">';
|
||||
@@ -2434,6 +2435,9 @@ console.log('FLOWDECK v2.4.6 — IIFE done, _wsInitData keys:', Object.keys(wind
|
||||
@blur="commitRename(node)" @click.stop style="width:100%">
|
||||
</span>
|
||||
</template>
|
||||
<template x-if="!node.is_folder">
|
||||
<a href="#" class="btn-open hover-only" @click.prevent.stop="selectForPreview(node)" title="Open in side preview" style="margin-left:auto;">↢ Open</a>
|
||||
</template>
|
||||
|
||||
<div class="actions">
|
||||
<template x-if="node.is_folder">
|
||||
@@ -2445,9 +2449,6 @@ console.log('FLOWDECK v2.4.6 — IIFE done, _wsInitData keys:', Object.keys(wind
|
||||
</template>
|
||||
<button class="ws-act" @click.stop="startRename(node)" title="Rename">{{ fd_icon("edit",14) }}</button>
|
||||
<button class="ws-act danger" @click.stop="deleteWithUndo(node)" title="Delete">{{ fd_icon("trash",14) }}</button>
|
||||
<template x-if="!node.is_folder">
|
||||
<a href="#" class="btn-open" @click.prevent.stop="selectForPreview(node)" title="Open in side preview" style="margin-left:auto;">↢ Open</a>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Children -->
|
||||
|
||||
Reference in New Issue
Block a user