mirror of
https://github.com/dbgate/dbgate
synced 2024-11-07 20:26:23 +00:00
abilit to split whole group
This commit is contained in:
parent
aa4406942f
commit
d1bdebb4ed
@ -91,13 +91,22 @@
|
|||||||
|
|
||||||
function splitTab(multiTabIndex) {
|
function splitTab(multiTabIndex) {
|
||||||
openedTabs.update(tabs =>
|
openedTabs.update(tabs =>
|
||||||
tabs.map((x, i) => ({
|
tabs.map(x => ({
|
||||||
...x,
|
...x,
|
||||||
multiTabIndex: x.selected ? 1 - multiTabIndex : x.multiTabIndex,
|
multiTabIndex: x.selected ? 1 - multiTabIndex : x.multiTabIndex,
|
||||||
}))
|
}))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function splitTabGroup(tabGroupTabs, multiTabIndex) {
|
||||||
|
openedTabs.update(tabs =>
|
||||||
|
tabs.map(x => ({
|
||||||
|
...x,
|
||||||
|
multiTabIndex: tabGroupTabs.find(y => x.tabid == y.tabid) ? 1 - multiTabIndex : x.multiTabIndex,
|
||||||
|
}))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
const closeTab = closeTabFunc((x, active) => x.tabid == active.tabid);
|
const closeTab = closeTabFunc((x, active) => x.tabid == active.tabid);
|
||||||
const closeAll = async () => {
|
const closeAll = async () => {
|
||||||
const closeCandidates = getOpenedTabs()
|
const closeCandidates = getOpenedTabs()
|
||||||
@ -510,11 +519,21 @@
|
|||||||
<FontIcon icon="icon lock" />
|
<FontIcon icon="icon lock" />
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div class="tab-group-buttons">
|
||||||
class="close-button-right tabCloseButton"
|
{#if allowSplitTab}
|
||||||
on:click={e => closeMultipleTabs(tab => tabGroup.tabs.find(x => x.tabid == tab.tabid))}
|
<div
|
||||||
>
|
class="tab-group-button tabCloseButton"
|
||||||
<FontIcon icon="icon close" />
|
on:click={e => splitTabGroup(tabGroup.tabs, multiTabIndex)}
|
||||||
|
>
|
||||||
|
<FontIcon icon="icon split" />
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
|
<div
|
||||||
|
class="tab-group-button tabCloseButton"
|
||||||
|
on:click={e => closeMultipleTabs(tab => tabGroup.tabs.find(x => x.tabid == tab.tabid))}
|
||||||
|
>
|
||||||
|
<FontIcon icon="icon close" />
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
@ -673,13 +692,14 @@
|
|||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
}
|
}
|
||||||
.close-button-right {
|
.tab-group-buttons {
|
||||||
margin-left: 5px;
|
margin-left: 5px;
|
||||||
margin-right: 5px;
|
margin-right: 5px;
|
||||||
color: var(--theme-font-3);
|
color: var(--theme-font-3);
|
||||||
|
display: flex;
|
||||||
}
|
}
|
||||||
|
|
||||||
.close-button-right:hover {
|
.tab-group-button:hover {
|
||||||
color: var(--theme-font-1);
|
color: var(--theme-font-1);
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
Loading…
Reference in New Issue
Block a user