Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

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

Yingyi / 颖逸73946e1b1859
diff --git a/app/src/layout/dock/Custom.ts b/app/src/layout/dock/Custom.ts
index f2a8de4b24..700047ea9e 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;