reimplementation of frontend's api.addButtonToToolbar() to smoothen the upgrade

This commit is contained in:
zadam
2022-12-17 21:46:51 +01:00
parent 967919b400
commit 5af506e268
14 changed files with 382 additions and 161 deletions

View File

@@ -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();
}
}
}
}