mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-18 23:50:13 +01:00
This commit is contained in:
parent
ea2c6fa6be
commit
2d99bf6a8f
1 changed files with 8 additions and 6 deletions
|
|
@ -333,22 +333,24 @@ export const closeTabByType = async (tab: Tab, type: "closeOthers" | "closeAll"
|
||||||
index--;
|
index--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return;
|
} else if (type === "closeAll") {
|
||||||
}
|
|
||||||
if (type === "closeAll") {
|
|
||||||
for (let index = 0; index < tab.parent.children.length; index++) {
|
for (let index = 0; index < tab.parent.children.length; index++) {
|
||||||
if (!tab.parent.children[index].headElement.classList.contains("item--pin")) {
|
if (!tab.parent.children[index].headElement.classList.contains("item--pin")) {
|
||||||
await tab.parent.children[index].parent.removeTab(tab.parent.children[index].id, true);
|
await tab.parent.children[index].parent.removeTab(tab.parent.children[index].id, true);
|
||||||
index--;
|
index--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return;
|
} else if (tabs.length > 0) {
|
||||||
}
|
|
||||||
if (tabs.length > 0) {
|
|
||||||
for (let index = 0; index < tabs.length; index++) {
|
for (let index = 0; index < tabs.length; index++) {
|
||||||
if (!tabs[index].headElement.classList.contains("item--pin")) {
|
if (!tabs[index].headElement.classList.contains("item--pin")) {
|
||||||
await tabs[index].parent.removeTab(tabs[index].id);
|
await tabs[index].parent.removeTab(tabs[index].id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (tab.headElement.parentElement && !tab.headElement.parentElement.querySelector(".item--focus")) {
|
||||||
|
tab.parent.switchTab(tab.headElement, true);
|
||||||
|
} else if (tab.parent.children.length > 0) {
|
||||||
|
tab.parent.switchTab(tab.parent.children[tab.parent.children.length - 1].headElement, true);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue