mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-27 11:25:59 +00:00
ctx menu - open in new window
This commit is contained in:
@@ -826,6 +826,12 @@
|
|||||||
onClick: () => {
|
onClick: () => {
|
||||||
databaseObjectMenuClickHandler(data, menu);
|
databaseObjectMenuClickHandler(data, menu);
|
||||||
},
|
},
|
||||||
|
iconAlt: menu.defaultActionId ? 'icon open-in-new' : null,
|
||||||
|
onClickAlt: menu.defaultActionId
|
||||||
|
? () => {
|
||||||
|
databaseObjectMenuClickHandler(data, { ...menu, forceNewTab: true, defaultActionId: null });
|
||||||
|
}
|
||||||
|
: null,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -85,6 +85,13 @@
|
|||||||
if (item.onClick) item.onClick();
|
if (item.onClick) item.onClick();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function handleClickAlt(e, item) {
|
||||||
|
if (item.disabled) return;
|
||||||
|
dispatchClose();
|
||||||
|
if (onCloseParent) onCloseParent();
|
||||||
|
if (item.onClickAlt) item.onClickAlt();
|
||||||
|
}
|
||||||
|
|
||||||
onMount(() => {
|
onMount(() => {
|
||||||
fixPopupPlacement(element);
|
fixPopupPlacement(element);
|
||||||
});
|
});
|
||||||
@@ -128,6 +135,11 @@
|
|||||||
{#if item.keyText}
|
{#if item.keyText}
|
||||||
<span class="keyText">{formatKeyText(item.keyText)}</span>
|
<span class="keyText">{formatKeyText(item.keyText)}</span>
|
||||||
{/if}
|
{/if}
|
||||||
|
{#if item.iconAlt}
|
||||||
|
<span class="alt-icon" on:click={e => handleClickAlt(e, item)}>
|
||||||
|
<FontIcon icon={item.iconAlt} />
|
||||||
|
</span>
|
||||||
|
{/if}
|
||||||
{#if item.submenu}
|
{#if item.submenu}
|
||||||
<div class="menu-right">
|
<div class="menu-right">
|
||||||
<FontIcon icon="icon menu-right" />
|
<FontIcon icon="icon menu-right" />
|
||||||
@@ -166,7 +178,7 @@
|
|||||||
cursor: default;
|
cursor: default;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
max-height: calc(100% - 20px)
|
max-height: calc(100% - 20px);
|
||||||
}
|
}
|
||||||
|
|
||||||
.keyText {
|
.keyText {
|
||||||
@@ -205,4 +217,12 @@
|
|||||||
position: relative;
|
position: relative;
|
||||||
left: 15px;
|
left: 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.alt-icon:hover {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.alt-icon:hover {
|
||||||
|
color: var(--theme-font-hover);
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user