reveal view
This commit is contained in:
parent
fdacd20f38
commit
0363c0f167
9
main.ts
9
main.ts
|
@ -54,15 +54,18 @@ export default class Intelligence extends Plugin {
|
||||||
}
|
}
|
||||||
|
|
||||||
async activateView() {
|
async activateView() {
|
||||||
this.app.workspace.detachLeavesOfType(INTELLIGENCE_VIEW_TYPE);
|
|
||||||
|
if (this.app.workspace.getLeavesOfType(INTELLIGENCE_VIEW_TYPE).length > 0) {
|
||||||
|
this.revealView();
|
||||||
|
return;
|
||||||
|
}
|
||||||
await this.app.workspace.getRightLeaf(false).setViewState({
|
await this.app.workspace.getRightLeaf(false).setViewState({
|
||||||
type: INTELLIGENCE_VIEW_TYPE,
|
type: INTELLIGENCE_VIEW_TYPE,
|
||||||
active: true,
|
active: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
this.revealView();
|
this.revealView();
|
||||||
}
|
}
|
||||||
|
|
||||||
async revealView() {
|
async revealView() {
|
||||||
this.app.workspace.revealLeaf(
|
this.app.workspace.revealLeaf(
|
||||||
this.app.workspace.getLeavesOfType(INTELLIGENCE_VIEW_TYPE)[0],
|
this.app.workspace.getLeavesOfType(INTELLIGENCE_VIEW_TYPE)[0],
|
||||||
|
|
Loading…
Reference in New Issue