mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-29 03:36:10 +01:00
This commit is contained in:
parent
e14ca5799b
commit
73505073e6
12 changed files with 42 additions and 59 deletions
|
|
@ -19,9 +19,9 @@ export class Editor extends Model {
|
|||
app: App,
|
||||
tab: Tab,
|
||||
blockId: string,
|
||||
rootId?: string, // 使用 rootId 会优先使用本地 filepositon 定位
|
||||
mode?: TEditorMode,
|
||||
action?: string[],
|
||||
scrollAttr?: IScrollAttr
|
||||
}) {
|
||||
super({
|
||||
app: options.app,
|
||||
|
|
@ -38,19 +38,19 @@ export class Editor extends Model {
|
|||
private initProtyle(options: {
|
||||
blockId: string,
|
||||
action?: string[]
|
||||
rootId?: string,
|
||||
mode?: TEditorMode,
|
||||
scrollAttr?: IScrollAttr
|
||||
}) {
|
||||
this.editor = new Protyle(this.app, this.element, {
|
||||
action: options.action || [],
|
||||
blockId: options.blockId,
|
||||
rootId: options.rootId,
|
||||
mode: options.mode,
|
||||
render: {
|
||||
title: true,
|
||||
background: true,
|
||||
scroll: true,
|
||||
},
|
||||
scrollAttr: options.scrollAttr,
|
||||
typewriterMode: true,
|
||||
after: (editor) => {
|
||||
if (window.siyuan.editorIsFullscreen) {
|
||||
|
|
|
|||
|
|
@ -277,7 +277,7 @@ export const openFile = async (options: IOpenFileOptions) => {
|
|||
createdTab = newTab(options);
|
||||
wnd.addTab(createdTab);
|
||||
if (unUpdateTab && options.removeCurrentTab) {
|
||||
wnd.removeTab(unUpdateTab.id, false, true, false);
|
||||
wnd.removeTab(unUpdateTab.id, false, false);
|
||||
}
|
||||
} else {
|
||||
createdTab = newTab(options);
|
||||
|
|
@ -306,7 +306,6 @@ const getUnInitTab = (options: IOpenFileOptions) => {
|
|||
} else {
|
||||
initObj.action = options.action;
|
||||
}
|
||||
delete initObj.scrollAttr;
|
||||
item.headElement.setAttribute("data-initdata", JSON.stringify(initObj));
|
||||
item.parent.switchTab(item.headElement);
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue