mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-21 09:00:12 +01:00
This commit is contained in:
parent
cd82976170
commit
a7d951856c
7 changed files with 1564 additions and 61 deletions
|
|
@ -31,6 +31,7 @@ export const openFileById = (options: {
|
|||
action?: string[]
|
||||
keepCursor?: boolean
|
||||
zoomIn?: boolean
|
||||
removeCurrentTab?: boolean
|
||||
}) => {
|
||||
fetchPost("/api/block/getBlockInfo", {id: options.id}, (data) => {
|
||||
if (data.code === 2) {
|
||||
|
|
@ -41,13 +42,14 @@ export const openFileById = (options: {
|
|||
openFile({
|
||||
fileName: data.data.rootTitle,
|
||||
rootIcon: data.data.rootIcon,
|
||||
id: options.id,
|
||||
rootID: data.data.rootID,
|
||||
id: options.id,
|
||||
position: options.position,
|
||||
mode: options.mode,
|
||||
action: options.action,
|
||||
zoomIn: options.zoomIn,
|
||||
keepCursor: options.keepCursor
|
||||
keepCursor: options.keepCursor,
|
||||
removeCurrentTab: options.removeCurrentTab
|
||||
});
|
||||
});
|
||||
};
|
||||
|
|
@ -178,8 +180,8 @@ const openFile = (options: IOpenFileOptions) => {
|
|||
}
|
||||
});
|
||||
wnd.addTab(newTab(options));
|
||||
if (unUpdateTab && !window.siyuan.ctrlIsPressed) {
|
||||
wnd.removeTab(unUpdateTab.id);
|
||||
if (unUpdateTab && options.removeCurrentTab) {
|
||||
wnd.removeTab(unUpdateTab.id, false, true, false);
|
||||
}
|
||||
} else {
|
||||
wnd.addTab(newTab(options));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue