mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-28 01:56:01 -05:00
Reload page when dealing with mass actions on topic.
This commit is contained in:
parent
113cb4d3ad
commit
b549ed15b9
2 changed files with 7 additions and 4 deletions
|
@ -39,11 +39,11 @@ export default Ember.Controller.extend(SelectedPostsCount, ModalFunctionality, {
|
|||
username: this.get('new_user')
|
||||
};
|
||||
|
||||
Discourse.Topic.changeOwners(this.get('topicController.model.id'), saveOpts).then(function(result) {
|
||||
Discourse.Topic.changeOwners(this.get('topicController.model.id'), saveOpts).then(function() {
|
||||
// success
|
||||
self.send('closeModal');
|
||||
self.get('topicController').send('toggleMultiSelect');
|
||||
Em.run.next(function() { DiscourseURL.routeTo(result.url); });
|
||||
Em.run.next(() => { DiscourseURL.routeTo(self.get("topicController.model.url")); });
|
||||
}, function() {
|
||||
// failure
|
||||
self.flash(I18n.t('topic.change_owner.error'), 'alert-error');
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import ModalFunctionality from 'discourse/mixins/modal-functionality';
|
||||
import computed from 'ember-addons/ember-computed-decorators';
|
||||
import DiscourseURL from 'discourse/lib/url';
|
||||
|
||||
// Modal related to changing the timestamp of posts
|
||||
export default Ember.Controller.extend(ModalFunctionality, {
|
||||
|
@ -40,14 +41,16 @@ export default Ember.Controller.extend(ModalFunctionality, {
|
|||
actions: {
|
||||
changeTimestamp: function() {
|
||||
this.set('saving', true);
|
||||
const self = this;
|
||||
const self = this,
|
||||
topic = this.get('topicController.model');
|
||||
|
||||
Discourse.Topic.changeTimestamp(
|
||||
this.get('topicController.model.id'),
|
||||
topic.get('id'),
|
||||
this.get('createdAt').unix()
|
||||
).then(function() {
|
||||
self.send('closeModal');
|
||||
self.setProperties({ date: '', time: '', saving: false });
|
||||
Em.run.next(() => { DiscourseURL.routeTo(topic.get('url')); });
|
||||
}).catch(function() {
|
||||
self.flash(I18n.t('topic.change_timestamp.error'), 'alert-error');
|
||||
self.set('saving', false);
|
||||
|
|
Loading…
Reference in a new issue