DEV: Switch to new addComposerToolbarPopupMenuOption plugin API (#25)

Why this change?

`api.addToolbarPopupMenuOptionsCallback` has been deprecated in 913fd3a7b3
This commit is contained in:
Alan Guo Xiang Tan 2023-10-23 08:08:57 +08:00 committed by GitHub
parent 3ca2000263
commit 344f4dd0ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 19 deletions

View File

@ -1,2 +1,3 @@
< 3.2.0.beta2: 3ca2000263c8f99ebadca61ef62b3fa7e48e85ea
3.1.999: 322db3406e37b1bd146564ce48c7da28ebe7dd61
2.9.0.beta8: 1c4f5b1a99cfa610f13723bf0b3a5cf5c77e1ff4

View File

@ -292,25 +292,15 @@ export default {
{ onlyStream: true, id: "discourse-placeholder-theme-component" }
);
api.addToolbarPopupMenuOptionsCallback(() => {
return {
action: "insertPlaceholder",
icon: "file",
label: themePrefix("toolbar.builder"),
};
});
api.modifyClass("controller:composer", {
pluginId: "discourse-placeholder-theme-component",
actions: {
insertPlaceholder() {
showModal("discourse-placeholder-builder", {
model: {
toolbarEvent: this.toolbarEvent,
},
});
},
api.addComposerToolbarPopupMenuOption({
label: themePrefix("toolbar.builder"),
icon: "file",
action: (toolbarEvent) => {
showModal("discourse-placeholder-builder", {
model: {
toolbarEvent,
},
});
},
});
});