mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-26 19:38:48 +01:00
This commit is contained in:
parent
c0266ffeb4
commit
fb0e5b20cb
1 changed files with 13 additions and 3 deletions
|
|
@ -131,13 +131,23 @@ const splitSubMenu = (app: App, tab: Tab) => {
|
|||
}
|
||||
});
|
||||
}
|
||||
const wndsTemp: Wnd[] = [];
|
||||
getAllWnds(window.siyuan.layout.layout, wndsTemp);
|
||||
let wndsTemp: Wnd[] = [];
|
||||
getAllWnds(window.siyuan.layout.centerLayout, wndsTemp);
|
||||
if (wndsTemp.length > 1) {
|
||||
subMenus.push({
|
||||
label: window.siyuan.languages.unsplit,
|
||||
click: () => {
|
||||
unsplitWnd(tab.parent.parent.children[0], tab.parent.parent, true);
|
||||
let layout = tab.parent.parent;
|
||||
while (layout.id !== window.siyuan.layout.centerLayout.id) {
|
||||
wndsTemp = [];
|
||||
getAllWnds(layout, wndsTemp);
|
||||
if (wndsTemp.length > 1) {
|
||||
break;
|
||||
} else {
|
||||
layout = layout.parent;
|
||||
}
|
||||
}
|
||||
unsplitWnd(tab.parent.parent.children[0], layout, true);
|
||||
resizeTabs();
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue