Bulk close operation

This commit is contained in:
Robin Ward
2014-01-30 12:44:40 -05:00
parent e9664d5cfa
commit 6f23870327
6 changed files with 66 additions and 13 deletions
@@ -9,7 +9,7 @@
**/
Discourse.TopicBulkActionsController = Ember.ArrayController.extend(Discourse.ModalFunctionality, {
onShow: function() {
this.set('controllers.modal.modalClass', 'topic-bulk-actions-modal');
this.set('controllers.modal.modalClass', 'topic-bulk-actions-modal small');
},
perform: function(operation) {
@@ -30,9 +30,26 @@ Discourse.TopicBulkActionsController = Ember.ArrayController.extend(Discourse.Mo
});
},
forEachPerformed: function(operation, cb) {
var self = this;
this.perform(operation).then(function (topics) {
if (topics) {
topics.forEach(cb);
self.send('closeModal');
}
});
},
actions: {
showChangeCategory: function() {
this.send('changeBulkTemplate', 'modal/bulk_change_category');
this.set('controllers.modal.modalClass', 'topic-bulk-actions-modal full');
},
closeTopics: function() {
this.forEachPerformed({type: 'close'}, function(t) {
t.set('closed', true);
});
},
changeCategory: function() {
@@ -1 +1,2 @@
<button class='btn' {{action showChangeCategory}}>{{i18n topics.bulk.change_category}}</button>
<button class='btn' {{action closeTopics}}>{{i18n topics.bulk.close_topics}}</button>
+3 -3
View File
@@ -251,9 +251,9 @@
p {
margin-top: 0;
}
.modal-body {
height: 420px;
max-height: 420px;
&.full .modal-body {
height: 400px;
max-height: 400px;
}
}
.tabbed-modal {