generated from obsidianmd/obsidian-sample-plugin
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathview.ts
41 lines (33 loc) · 840 Bytes
/
view.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import {ItemView, WorkspaceLeaf} from "obsidian";
import type {WienerLinienSettings} from "./main";
import Main from "components/Main.svelte"
export const VIEW_TYPE_WIENER_LINIEN = "wiener-linien-view";
export class WienerLinienView extends ItemView {
component: Main | undefined;
settings: WienerLinienSettings | undefined;
constructor(leaf: WorkspaceLeaf, settings?: WienerLinienSettings) {
super(leaf);
this.settings = settings;
}
getViewType() {
return VIEW_TYPE_WIENER_LINIEN;
}
getDisplayText() {
return "Wiener Linien";
}
getIcon() {
return "train";
}
async onOpen() {
this.component = new Main({
target: this.contentEl,
props: {
rblNumbers: this.settings!.rblNumbers,
showRelatedLines: this.settings!.showRelatedLines,
}
});
}
async onClose() {
this.component?.$destroy();
}
}