mirror of
https://github.com/discourse/discourse.git
synced 2024-11-24 17:15:32 +08:00
Merge pull request #3737 from tgxworld/reload_page
Reload page when dealing with mass actions on topic.
This commit is contained in:
commit
cf114f323d
|
@ -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 New Issue
Block a user