From 73946e1b185917b3128855b8cb532b571142de9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yingyi=20/=20=E9=A2=96=E9=80=B8?= <49649786+Zuoqiu-Yingyi@users.noreply.github.com> Date: Tue, 23 May 2023 19:29:10 +0800 Subject: [PATCH] feat: Add `Tag` context to the method in plugin `addTab` (#8336) --- app/src/layout/dock/Custom.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/layout/dock/Custom.ts b/app/src/layout/dock/Custom.ts index f2a8de4b2..700047ea9 100644 --- a/app/src/layout/dock/Custom.ts +++ b/app/src/layout/dock/Custom.ts @@ -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;