mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-22 09:30:14 +01:00
This commit is contained in:
parent
491641f499
commit
798a2970f9
1 changed files with 15 additions and 0 deletions
|
|
@ -10,6 +10,7 @@ import {getDockByType, setPanelFocus} from "../layout/util";
|
||||||
import {hasClosestByAttribute} from "../protyle/util/hasClosest";
|
import {hasClosestByAttribute} from "../protyle/util/hasClosest";
|
||||||
import {BlockPanel} from "../block/Panel";
|
import {BlockPanel} from "../block/Panel";
|
||||||
import {Setting} from "./Setting";
|
import {Setting} from "./Setting";
|
||||||
|
import {getAllModels} from "../layout/getAll";
|
||||||
|
|
||||||
export class Plugin {
|
export class Plugin {
|
||||||
private app: App;
|
private app: App;
|
||||||
|
|
@ -180,6 +181,20 @@ export class Plugin {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public getOpenedTab() {
|
||||||
|
const tabs: { [key: string]: Custom[] } = {}
|
||||||
|
const modelKeys = Object.keys(this.models)
|
||||||
|
modelKeys.forEach(item => {
|
||||||
|
tabs[item.replace(this.name, "")] = []
|
||||||
|
})
|
||||||
|
getAllModels().custom.find(item => {
|
||||||
|
if (modelKeys.includes(item.type)) {
|
||||||
|
tabs[item.type.replace(this.name, "")].push(item);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return tabs;
|
||||||
|
}
|
||||||
|
|
||||||
public addTab(options: {
|
public addTab(options: {
|
||||||
type: string,
|
type: string,
|
||||||
destroy?: () => void,
|
destroy?: () => void,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue