feat: Add Tag context to the method in plugin addTab (#8336)

This commit is contained in:
Yingyi / 颖逸 2023-05-23 19:29:10 +08:00 committed by GitHub
parent 07b0ccbabe
commit 73946e1b18
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4,6 +4,7 @@ import {App} from "../../index";
export class Custom extends Model {
public element: Element;
public tab: Tab;
public data: any;
public type: string;
public init: () => void;
@ -22,12 +23,14 @@ export class Custom extends Model {
init: () => void
}) {
super({app: options.app, id: options.tab.id});
this.type = options.type;
if (window.siyuan.config.fileTree.openFilesUseCurrentTab) {
options.tab.headElement.classList.add("item--unupdate");
}
this.element = options.tab.panelElement;
this.tab = options.tab;
this.data = options.data;
this.type = options.type;
this.init = options.init;
this.destroy = options.destroy;
this.resize = options.resize;