discourse/app/assets/javascripts/discourse/mixins/modal-functionality.js.es6
2019-05-27 10:15:39 +02:00

27 lines
519 B
JavaScript

import showModal from "discourse/lib/show-modal";
export default Ember.Mixin.create({
flash(text, messageClass) {
this.appEvents.trigger("modal-body:flash", { text, messageClass });
},
clearFlash() {
this.appEvents.trigger("modal-body:clearFlash");
},
showModal(...args) {
return showModal(...args);
},
actions: {
closeModal() {
this.modal.send("closeModal");
this.set("panels", []);
},
onSelectPanel(panel) {
this.set("selectedPanel", panel);
}
}
});