mirror of
https://github.com/t8y2/dbx.git
synced 2026-10-30 00:19:35 +00:00
revert: restore single-click to open table data in sidebar
This commit is contained in:
@@ -199,15 +199,10 @@ async function toggle() {
|
||||
function onClick() {
|
||||
const node = props.node;
|
||||
const action = treeNodeRowAction(node.type, canExpand);
|
||||
if (action === "toggle") {
|
||||
toggle();
|
||||
}
|
||||
}
|
||||
|
||||
function onDblClick() {
|
||||
const node = props.node;
|
||||
if (node.type === "table" || node.type === "view") {
|
||||
if (action === "open-data") {
|
||||
openData();
|
||||
} else if (action === "toggle") {
|
||||
toggle();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -772,7 +767,6 @@ const isDragging = computed(() =>
|
||||
@mousedown="isDraggable ? startDrag($event, node.id, node.type) : undefined"
|
||||
@mousemove="isDropTarget ? updateTarget($event, node.id, node.type) : undefined"
|
||||
@mouseleave="clearTarget(node.id)"
|
||||
@dblclick="onDblClick"
|
||||
>
|
||||
<div v-if="showDropBefore" class="absolute right-2 top-0 h-0.5 bg-primary rounded-full pointer-events-none" :style="{ left: paddingLeft }" />
|
||||
<div v-if="showDropAfter" class="absolute right-2 bottom-0 h-0.5 bg-primary rounded-full pointer-events-none" :style="{ left: paddingLeft }" />
|
||||
|
||||
@@ -6,7 +6,7 @@ const dataNodeTypes = new Set<TreeNodeType>(["table", "view"]);
|
||||
const toggleLeafNodeTypes = new Set<TreeNodeType>(["redis-db", "mongo-collection"]);
|
||||
|
||||
export function treeNodeRowAction(type: TreeNodeType, canExpand: boolean): TreeNodeRowAction {
|
||||
if (dataNodeTypes.has(type)) return "none";
|
||||
if (dataNodeTypes.has(type)) return "open-data";
|
||||
if (toggleLeafNodeTypes.has(type)) return "toggle";
|
||||
if (canExpand) return "toggle";
|
||||
return "none";
|
||||
|
||||
Reference in New Issue
Block a user