mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-21 09:00:12 +01:00
This commit is contained in:
parent
2ba32ffc7c
commit
5022e3c6c9
3 changed files with 35 additions and 31 deletions
|
|
@ -414,7 +414,10 @@ export const resizeTabs = () => {
|
|||
setPadding(item.editor.protyle);
|
||||
if (typeof echarts !== "undefined") {
|
||||
item.editor.protyle.wysiwyg.element.querySelectorAll('[data-subtype="echarts"], [data-subtype="mindmap"]').forEach((chartItem: HTMLElement) => {
|
||||
echarts.getInstanceById(chartItem.firstElementChild.nextElementSibling.getAttribute("_echarts_instance_")).resize();
|
||||
const chartInstance = echarts.getInstanceById(chartItem.firstElementChild.nextElementSibling.getAttribute("_echarts_instance_"))
|
||||
if (chartInstance) {
|
||||
chartInstance.resize();
|
||||
}
|
||||
});
|
||||
}
|
||||
}, 200);
|
||||
|
|
|
|||
|
|
@ -315,6 +315,7 @@ export const openFileAttr = (attrs: IObject, id: string, focusName = "bookmark")
|
|||
if (errorTip) {
|
||||
showMessage(errorTip.substr(0, errorTip.length - 2) + " " + window.siyuan.languages.invalid);
|
||||
}
|
||||
if (!isMobile()) {
|
||||
getAllModels().editor.forEach(item => {
|
||||
if (item.editor.protyle.block.rootID === id) {
|
||||
const refElement = item.editor.protyle.title.element.querySelector(".protyle-attr--refcount");
|
||||
|
|
@ -325,6 +326,7 @@ export const openFileAttr = (attrs: IObject, id: string, focusName = "bookmark")
|
|||
item.editor.protyle.wysiwyg.renderCustom(attrsResult);
|
||||
}
|
||||
});
|
||||
}
|
||||
fetchPost("/api/attr/resetBlockAttrs", {id, attrs: attrsResult}, () => {
|
||||
if (attrsResult.bookmark !== attrs.bookmark) {
|
||||
const bookmark = getDockByType("bookmark").data.bookmark;
|
||||
|
|
|
|||
|
|
@ -30,9 +30,6 @@ export const initNavigationMenu = (liElement: HTMLElement) => {
|
|||
const name = getNotebookName(notebookId);
|
||||
window.siyuan.menus.menu.remove();
|
||||
window.siyuan.menus.menu.append(newFileMenu(notebookId, "/", true));
|
||||
/// #if !BROWSER
|
||||
genImportMenu(notebookId, "/");
|
||||
/// #endif
|
||||
window.siyuan.menus.menu.append(new MenuItem({type: "separator"}).element);
|
||||
if (!window.siyuan.config.readonly) {
|
||||
window.siyuan.menus.menu.append(renameMenu({
|
||||
|
|
@ -104,6 +101,9 @@ export const initNavigationMenu = (liElement: HTMLElement) => {
|
|||
shell.openPath(pathPosix().join(window.siyuan.config.system.dataDir, notebookId));
|
||||
}
|
||||
}).element);
|
||||
if (!window.siyuan.config.readonly) {
|
||||
genImportMenu(notebookId, "/");
|
||||
}
|
||||
window.siyuan.menus.menu.append(new MenuItem({
|
||||
label: window.siyuan.languages.export,
|
||||
icon: "iconUpload",
|
||||
|
|
@ -127,7 +127,6 @@ export const initFileMenu = (notebookId: string, pathString: string, id: string,
|
|||
name = getDisplayName(name, false, true);
|
||||
if (!window.siyuan.config.readonly) {
|
||||
window.siyuan.menus.menu.append(newFileMenu(notebookId, pathString, true));
|
||||
genImportMenu(notebookId, pathString);
|
||||
window.siyuan.menus.menu.append(new MenuItem({type: "separator"}).element);
|
||||
window.siyuan.menus.menu.append(new MenuItem({
|
||||
label: window.siyuan.languages.copy,
|
||||
|
|
@ -142,7 +141,15 @@ export const initFileMenu = (notebookId: string, pathString: string, id: string,
|
|||
}
|
||||
}])
|
||||
}).element);
|
||||
if (!isMobile()) {
|
||||
window.siyuan.menus.menu.append(movePathToMenu(notebookId, pathString));
|
||||
window.siyuan.menus.menu.append(deleteMenu(notebookId, name, pathString));
|
||||
window.siyuan.menus.menu.append(new MenuItem({type: "separator"}).element);
|
||||
window.siyuan.menus.menu.append(renameMenu({
|
||||
path: pathString,
|
||||
notebookId,
|
||||
name,
|
||||
type: "file"
|
||||
}));
|
||||
window.siyuan.menus.menu.append(new MenuItem({
|
||||
label: window.siyuan.languages.attr,
|
||||
click() {
|
||||
|
|
@ -153,14 +160,7 @@ export const initFileMenu = (notebookId: string, pathString: string, id: string,
|
|||
});
|
||||
}
|
||||
}).element);
|
||||
}
|
||||
window.siyuan.menus.menu.append(renameMenu({
|
||||
path: pathString,
|
||||
notebookId,
|
||||
name,
|
||||
type: "file"
|
||||
}));
|
||||
window.siyuan.menus.menu.append(movePathToMenu(notebookId, pathString));
|
||||
|
||||
/// #if !MOBILE
|
||||
window.siyuan.menus.menu.append(new MenuItem({
|
||||
label: window.siyuan.languages.search,
|
||||
|
|
@ -179,10 +179,6 @@ export const initFileMenu = (notebookId: string, pathString: string, id: string,
|
|||
}).element);
|
||||
/// #endif
|
||||
window.siyuan.menus.menu.append(new MenuItem({type: "separator"}).element);
|
||||
window.siyuan.menus.menu.append(deleteMenu(notebookId, name, pathString));
|
||||
if (!isMobile()) {
|
||||
window.siyuan.menus.menu.append(new MenuItem({type: "separator"}).element);
|
||||
}
|
||||
}
|
||||
const openSubmenus: IMenu[] = [{
|
||||
icon: "iconRight",
|
||||
|
|
@ -237,6 +233,9 @@ export const initFileMenu = (notebookId: string, pathString: string, id: string,
|
|||
submenu: openSubmenus,
|
||||
}).element);
|
||||
}
|
||||
if (!window.siyuan.config.readonly) {
|
||||
genImportMenu(notebookId, pathString);
|
||||
}
|
||||
window.siyuan.menus.menu.append(exportMd(id));
|
||||
return window.siyuan.menus.menu;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue