mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-19 16:10:12 +01:00
This commit is contained in:
parent
699831835d
commit
8f271f6ef1
1 changed files with 15 additions and 0 deletions
|
|
@ -53,9 +53,18 @@ export const switchTabByIndex = (index: number) => {
|
||||||
} else if (index === -2) {
|
} else if (index === -2) {
|
||||||
// 上一个
|
// 上一个
|
||||||
indexElement = activeDockIcoElement.previousElementSibling;
|
indexElement = activeDockIcoElement.previousElementSibling;
|
||||||
|
if (!indexElement) {
|
||||||
|
indexElement = activeDockIcoElement.parentElement.lastElementChild;
|
||||||
|
if (indexElement.classList.contains("dock__item--pin")) {
|
||||||
|
indexElement = indexElement.previousElementSibling;
|
||||||
|
}
|
||||||
|
}
|
||||||
} else if (index === -3) {
|
} else if (index === -3) {
|
||||||
// 下一个
|
// 下一个
|
||||||
indexElement = activeDockIcoElement.nextElementSibling;
|
indexElement = activeDockIcoElement.nextElementSibling;
|
||||||
|
if (!indexElement || indexElement.classList.contains("dock__item--pin")) {
|
||||||
|
indexElement = activeDockIcoElement.parentElement.firstElementChild;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
const type = indexElement?.getAttribute("data-type");
|
const type = indexElement?.getAttribute("data-type");
|
||||||
if (type) {
|
if (type) {
|
||||||
|
|
@ -72,9 +81,15 @@ export const switchTabByIndex = (index: number) => {
|
||||||
} else if (index === -2) {
|
} else if (index === -2) {
|
||||||
// 上一个
|
// 上一个
|
||||||
indexElement = tab.headElement.previousElementSibling;
|
indexElement = tab.headElement.previousElementSibling;
|
||||||
|
if (!indexElement) {
|
||||||
|
indexElement = tab.headElement.parentElement.lastElementChild;
|
||||||
|
}
|
||||||
} else if (index === -3) {
|
} else if (index === -3) {
|
||||||
// 下一个
|
// 下一个
|
||||||
indexElement = tab.headElement.nextElementSibling;
|
indexElement = tab.headElement.nextElementSibling;
|
||||||
|
if (!indexElement) {
|
||||||
|
indexElement = tab.headElement.parentElement.firstElementChild;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (indexElement) {
|
if (indexElement) {
|
||||||
tab.parent.switchTab(indexElement as HTMLElement, true);
|
tab.parent.switchTab(indexElement as HTMLElement, true);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue