mirror of
https://github.com/flarum/core.git
synced 2025-07-30 21:20:24 +02:00
Rename and delete discussion controls
This commit is contained in:
@@ -102,6 +102,19 @@ export default Ember.Controller.extend(Ember.Evented, UseComposerMixin, {
|
||||
|
||||
postRemoved: function(post) {
|
||||
this.get('stream').removePost(post);
|
||||
},
|
||||
|
||||
rename: function(title) {
|
||||
var discussion = this.get('model');
|
||||
discussion.set('title', title);
|
||||
discussion.save();
|
||||
},
|
||||
|
||||
delete: function() {
|
||||
var controller = this;
|
||||
this.get('model').destroyRecord().then(function() {
|
||||
controller.transitionToRoute('index');
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user