mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-12-12 08:41:23 -05:00
31 lines
704 B
Text
31 lines
704 B
Text
|
import { withPluginApi } from 'discourse/lib/plugin-api';
|
||
|
import showModal from 'discourse/lib/show-modal';
|
||
|
|
||
|
function initializePollUIBuilder(api) {
|
||
|
const ComposerController = api.container.lookup("controller:composer");
|
||
|
|
||
|
ComposerController.reopen({
|
||
|
actions: {
|
||
|
showPollBuilder() {
|
||
|
showModal("poll-ui-builder").set("toolbarEvent", this.get("toolbarEvent"));
|
||
|
}
|
||
|
}
|
||
|
});
|
||
|
|
||
|
api.addToolbarPopupMenuOptionsCallback(function() {
|
||
|
return {
|
||
|
action: 'showPollBuilder',
|
||
|
icon: 'bar-chart-o',
|
||
|
label: 'poll.ui_builder.title'
|
||
|
};
|
||
|
});
|
||
|
}
|
||
|
|
||
|
export default {
|
||
|
name: "add-poll-ui-builder",
|
||
|
|
||
|
initialize() {
|
||
|
withPluginApi('0.1', initializePollUIBuilder);
|
||
|
}
|
||
|
};
|