mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-21 02:25:59 +00:00
vertical split tabs #394
This commit is contained in:
@@ -29,9 +29,24 @@ export function markTabSaved(tabid) {
|
||||
}
|
||||
|
||||
export function setSelectedTabFunc(files, tabid) {
|
||||
const oldSelected = files.find(x => x.selected);
|
||||
const newSelected = files.find(x => x.tabid == tabid);
|
||||
const changeVisibleSecondary = (oldSelected.multiTabIndex || 0) != (newSelected.multiTabIndex || 0);
|
||||
return [
|
||||
...(files || []).filter(x => x.tabid != tabid).map(x => ({ ...x, selected: false })),
|
||||
...(files || []).filter(x => x.tabid == tabid).map(x => ({ ...x, selected: true })),
|
||||
...(files || [])
|
||||
.filter(x => x.tabid != tabid)
|
||||
.map(x => ({
|
||||
...x,
|
||||
selected: false,
|
||||
visibleSecondary: changeVisibleSecondary ? x.selected : x.visibleSecondary,
|
||||
})),
|
||||
...(files || [])
|
||||
.filter(x => x.tabid == tabid)
|
||||
.map(x => ({
|
||||
...x,
|
||||
selected: true,
|
||||
visibleSecondary: false,
|
||||
})),
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user