FEATURE: Bulk reset read status.
This commit is contained in:
@@ -8,6 +8,8 @@
|
||||
@module Discourse
|
||||
**/
|
||||
Discourse.TopicBulkActionsController = Ember.ArrayController.extend(Discourse.ModalFunctionality, {
|
||||
needs: ['discoveryTopics'],
|
||||
|
||||
onShow: function() {
|
||||
this.set('controllers.modal.modalClass', 'topic-bulk-actions-modal small');
|
||||
},
|
||||
@@ -40,6 +42,14 @@ Discourse.TopicBulkActionsController = Ember.ArrayController.extend(Discourse.Mo
|
||||
});
|
||||
},
|
||||
|
||||
performAndRefresh: function(operation) {
|
||||
var self = this;
|
||||
return this.perform(operation).then(function() {
|
||||
self.get('controllers.discoveryTopics').send('refresh');
|
||||
self.send('closeModal');
|
||||
});
|
||||
},
|
||||
|
||||
actions: {
|
||||
showChangeCategory: function() {
|
||||
this.send('changeBulkTemplate', 'modal/bulk_change_category');
|
||||
@@ -66,6 +76,10 @@ Discourse.TopicBulkActionsController = Ember.ArrayController.extend(Discourse.Mo
|
||||
});
|
||||
self.send('closeModal');
|
||||
});
|
||||
},
|
||||
|
||||
resetRead: function() {
|
||||
this.performAndRefresh({ type: 'reset_read' });
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user