diff options
Diffstat (limited to 'main.ts')
| -rw-r--r-- | main.ts | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -15,7 +15,7 @@ export default class MyPlugin extends Plugin { await this.loadSettings();
// This creates an icon in the left ribbon.
- let ribbonIconEl = this.addRibbonIcon('dice', 'Sample Plugin', (evt: MouseEvent) => {
+ const ribbonIconEl = this.addRibbonIcon('dice', 'Sample Plugin', (evt: MouseEvent) => {
// Called when the user clicks the icon.
new Notice('This is a notice!');
});
@@ -23,7 +23,7 @@ export default class MyPlugin extends Plugin { ribbonIconEl.addClass('my-plugin-ribbon-class');
// This adds a status bar item to the bottom of the app. Does not work on mobile apps.
- let statusBarItemEl = this.addStatusBarItem();
+ const statusBarItemEl = this.addStatusBarItem();
statusBarItemEl.setText('Status Bar Text');
// This adds a simple command that can be triggered anywhere
@@ -49,7 +49,7 @@ export default class MyPlugin extends Plugin { name: 'Open sample modal (complex)',
checkCallback: (checking: boolean) => {
// Conditions to check
- let markdownView = this.app.workspace.getActiveViewOfType(MarkdownView);
+ const markdownView = this.app.workspace.getActiveViewOfType(MarkdownView);
if (markdownView) {
// If checking is true, we're simply "checking" if the command can be run.
// If checking is false, then we want to actually perform the operation.
@@ -95,12 +95,12 @@ class SampleModal extends Modal { }
onOpen() {
- let {contentEl} = this;
+ const {contentEl} = this;
contentEl.setText('Woah!');
}
onClose() {
- let {contentEl} = this;
+ const {contentEl} = this;
contentEl.empty();
}
}
@@ -114,7 +114,7 @@ class SampleSettingTab extends PluginSettingTab { }
display(): void {
- let {containerEl} = this;
+ const {containerEl} = this;
containerEl.empty();
|
