This commit is contained in:
Vanessa 2024-12-09 22:04:25 +08:00
parent d5cdab8e31
commit d2670874c0
4 changed files with 21 additions and 10 deletions

View file

@ -306,7 +306,7 @@ const JSONToDock = (json: any, app: App) => {
window.siyuan.layout.bottomDock = new Dock({position: "Bottom", data: json.bottom, app});
};
const removedTabs: Tab[] = []
const removedTabs: Tab[] = [];
export const JSONToCenter = (
app: App,
@ -437,7 +437,7 @@ export const JSONToCenter = (
} else if (json.children && Object.keys(json.children).length > 0) {
JSONToCenter(app, json.children, child);
} else if (child instanceof Tab) {
removedTabs.push(child)
removedTabs.push(child);
}
}
};
@ -517,7 +517,7 @@ export const JSONToLayout = (app: App, isStart: boolean) => {
// 移除没有数据的页签 https://github.com/siyuan-note/siyuan/issues/13390
removedTabs.forEach(item => {
item.parent.removeTab(item.id);
})
});
}
// 需放在 tab.parent.switchTab 后,否则当前 tab 永远为最后一个
app.plugins.forEach(item => {

View file

@ -349,9 +349,9 @@ class="fn__flex-1 fn__flex${["url", "text", "number", "email", "phone"].includes
}
});
element.addEventListener("click", (event) => {
const removeElement = hasClosestByAttribute(event.target as HTMLElement, "data-type", "remove")
const removeElement = hasClosestByAttribute(event.target as HTMLElement, "data-type", "remove");
if (removeElement) {
const blockElement = hasClosestBlock(removeElement)
const blockElement = hasClosestBlock(removeElement);
if (blockElement) {
transaction(protyle, [{
action: "removeAttrViewBlock",
@ -365,7 +365,7 @@ class="fn__flex-1 fn__flex${["url", "text", "number", "email", "phone"].includes
item.destroy();
return true;
}
})
});
}
}
event.stopPropagation();

View file

@ -14,10 +14,10 @@ export const searchMarkRender = (protyle: IProtyle, keys: string[], hlId?: strin
if (typeof hlId === "string") {
Array.from(protyle.wysiwyg.element.querySelectorAll(`[data-node-id='${hlId}']`)).find(item => {
if (!isInEmbedBlock(item)) {
hlBlockElement = item
return true
hlBlockElement = item;
return true;
}
})
});
}

View file

@ -268,7 +268,18 @@ declare namespace Config {
* User interface language
* Same as {@link IAppearance.lang}
*/
export type TLang = "en_US" | "es_ES" | "fr_FR" | "zh_CHT" | "zh_CN" | "ja_JP" | "it_IT" | "de_DE" | "he_IL" | "ru_RU" | "pl_PL";
export type TLang =
"en_US"
| "es_ES"
| "fr_FR"
| "zh_CHT"
| "zh_CN"
| "ja_JP"
| "it_IT"
| "de_DE"
| "he_IL"
| "ru_RU"
| "pl_PL";
/**
* SiYuan bazaar related configuration