DEV: Switch to new addComposerToolbarPopupMenuOption plugin API (#25)
Why this change?
`api.addToolbarPopupMenuOptionsCallback` has been deprecated in 913fd3a7b3
This commit is contained in:
parent
3ca2000263
commit
344f4dd0ea
|
@ -1,2 +1,3 @@
|
|||
< 3.2.0.beta2: 3ca2000263c8f99ebadca61ef62b3fa7e48e85ea
|
||||
3.1.999: 322db3406e37b1bd146564ce48c7da28ebe7dd61
|
||||
2.9.0.beta8: 1c4f5b1a99cfa610f13723bf0b3a5cf5c77e1ff4
|
||||
|
|
|
@ -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,
|
||||
},
|
||||
});
|
||||
},
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue