Fix: Multi-Select should close when an operation succeeds. A little refactoring, too.
This commit is contained in:
@@ -83,20 +83,20 @@ Discourse.TopicController = Discourse.ObjectController.extend({
|
||||
if (!modalController) return;
|
||||
|
||||
modalController.show(Discourse.MoveSelectedView.create({
|
||||
topicController: this,
|
||||
topic: this.get('content'),
|
||||
selectedPosts: this.get('selectedPosts')
|
||||
selectedPosts: this.get('selectedPosts'),
|
||||
}));
|
||||
},
|
||||
|
||||
deleteSelected: function() {
|
||||
var topicController = this;
|
||||
return bootbox.confirm(Em.String.i18n("post.delete.confirm", {
|
||||
count: this.get('selectedCount')
|
||||
}), function(result) {
|
||||
return bootbox.confirm(Em.String.i18n("post.delete.confirm", { count: this.get('selectedCount')}), function(result) {
|
||||
if (result) {
|
||||
var selectedPosts = topicController.get('selectedPosts');
|
||||
Discourse.Post.deleteMany(selectedPosts);
|
||||
topicController.get('content.posts').removeObjects(selectedPosts);
|
||||
topicController.toggleMultiSelect();
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user