1
0
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:
Toby Zerner
2015-02-12 15:18:17 +10:30
parent 6138825db6
commit 87159bd9a0
3 changed files with 30 additions and 1 deletions

View File

@@ -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');
});
}
}
});