Skip to content

Commit

Permalink
DEV: Switch to new addComposerToolbarPopupMenuOption plugin API (#19)
Browse files Browse the repository at this point in the history
Why this change?

`api.addToolbarPopupMenuOptionsCallback` has been deprecated in discourse/discourse@913fd3a
  • Loading branch information
tgxworld authored Oct 22, 2023
1 parent 97d4e7b commit 6b85701
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 17 deletions.
1 change: 1 addition & 0 deletions .discourse-compatibility
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
< 3.2.0.beta2: 97d4e7b550a62ea494ae38c06992be2b008f3fce
3.1.999: c4633135e5cca5172a853430447a87e36bf5f124

24 changes: 7 additions & 17 deletions javascripts/discourse/initializers/insert-jitsi.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,25 +79,15 @@ export default {
) {
// do nothing if limited to staff
} else {
api.modifyClass("controller:composer", {
pluginId: "discourse-jitsi",
actions: {
insertJitsiModal() {
showModal("insert-jitsi").setProperties({
toolbarEvent: this.get("toolbarEvent"),
});
},
api.addComposerToolbarPopupMenuOption({
icon: settings.button_icon,
label: themePrefix("composer_title"),
action: (toolbarEvent) => {
showModal("insert-jitsi").setProperties({
toolbarEvent,
});
},
});

api.addToolbarPopupMenuOptionsCallback(() => {
return {
id: "insert_jitsi_button",
icon: settings.button_icon,
action: "insertJitsiModal",
label: themePrefix("composer_title"),
};
});
}
} else {
api.onToolbarCreate((toolbar) => {
Expand Down

0 comments on commit 6b85701

Please sign in to comment.