mirror of
https://github.com/discourse/discourse.git
synced 2025-02-24 10:31:54 +08:00
20 lines
560 B
JavaScript
20 lines
560 B
JavaScript
import ModalFunctionality from 'discourse/mixins/modal-functionality';
|
|
|
|
export default Ember.Controller.extend(ModalFunctionality, {
|
|
removeAfter: null,
|
|
|
|
_agreeFlag(action) {
|
|
let flaggedPost = this.get('model');
|
|
return this.removeAfter(flaggedPost.agreeFlags(action), flaggedPost).then(() => {
|
|
this.send('closeModal');
|
|
});
|
|
},
|
|
|
|
actions: {
|
|
agreeFlagHidePost() { return this._agreeFlag("hide"); },
|
|
agreeFlagKeepPost() { return this._agreeFlag("keep"); },
|
|
agreeFlagRestorePost() { return this._agreeFlag("restore"); }
|
|
}
|
|
|
|
});
|