Merge pull request #12 from Arkshine/user-new-api
DEV: Switch to new addComposerToolbarPopupMenuOption plugin API
This commit is contained in:
commit
3f167f5242
1
.discourse-compatibility
Normal file
1
.discourse-compatibility
Normal file
@ -0,0 +1 @@
|
|||||||
|
< 3.2.0.beta2: 1cc5d51137652c3977640f064739a08b1d1fe1be
|
@ -59,31 +59,20 @@ api.onToolbarCreate(toolbar => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// EXTRAS
|
// EXTRAS
|
||||||
api.addToolbarPopupMenuOptionsCallback(() => {
|
api.addComposerToolbarPopupMenuOption({
|
||||||
return {
|
action: (toolbarEvent) => {
|
||||||
action: "floatleft",
|
toolbarEvent.applySurround('[wrap="floatl"]\n', '\n[/wrap]', "float_left_text");
|
||||||
icon: "indent",
|
},
|
||||||
label: "float_left_button"
|
icon: 'indent',
|
||||||
};
|
label: 'float_left_button',
|
||||||
});
|
|
||||||
api.addToolbarPopupMenuOptionsCallback(() => {
|
|
||||||
return {
|
|
||||||
action: "columns",
|
|
||||||
icon: "columns",
|
|
||||||
label: "columns_button"
|
|
||||||
};
|
|
||||||
});
|
});
|
||||||
|
|
||||||
api.modifyClass("controller:composer", {
|
api.addComposerToolbarPopupMenuOption({
|
||||||
pluginId: 'md-composer-extras',
|
action: (toolbarEvent) => {
|
||||||
actions: {
|
toolbarEvent.applySurround('[wrap="columns"]\n', '\n[/wrap]', "columns_text");
|
||||||
floatleft() {
|
|
||||||
this.get("toolbarEvent").applySurround('[wrap="floatl"]\n', '\n[/wrap]', "float_left_text");
|
|
||||||
},
|
},
|
||||||
columns() {
|
icon: 'columns',
|
||||||
this.get("toolbarEvent").applySurround('[wrap="columns"]\n', '\n[/wrap]', "columns_text");
|
label: 'columns_button',
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// TEXTS
|
// TEXTS
|
||||||
|
Loading…
Reference in New Issue
Block a user