mirror of
https://github.com/zadam/trilium.git
synced 2025-11-14 01:05:49 +01:00
reimplementation of frontend's api.addButtonToToolbar() to smoothen the upgrade
This commit is contained in:
@@ -6,12 +6,16 @@ export default class ScriptLauncher extends AbstractLauncher {
|
||||
|
||||
this.title(this.launcherNote.title)
|
||||
.icon(this.launcherNote.getIcon())
|
||||
.onClick(this.handler);
|
||||
.onClick(() => this.launch());
|
||||
}
|
||||
|
||||
async launch() {
|
||||
const script = await this.launcherNote.getRelationTarget('script');
|
||||
if (this.launcherNote.hasLabel('scriptInLauncherContent')) {
|
||||
await this.launcherNote.executeScript();
|
||||
} else {
|
||||
const script = await this.launcherNote.getRelationTarget('script');
|
||||
|
||||
await script.executeScript();
|
||||
await script.executeScript();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user