FIX: dual modal when selecting 'delete spammer' in flags section

This commit is contained in:
Régis Hanol 2014-08-29 12:54:24 +02:00
parent 8bda8a2235
commit 521cb6bd0d
2 changed files with 2 additions and 9 deletions

View file

@ -22,6 +22,7 @@ Discourse.AdminFlagsRouteType = Discourse.Route.extend({
@method deleteSpammer @method deleteSpammer
**/ **/
deleteSpammer: function (user) { deleteSpammer: function (user) {
this.send('closeModal');
user.deleteAsSpammer(function() { window.location.reload(); }); user.deleteAsSpammer(function() { window.location.reload(); });
} }
} }
@ -50,6 +51,3 @@ Discourse.AdminFlagsActiveRoute = Discourse.AdminFlagsRouteType.extend({
Discourse.AdminFlagsOldRoute = Discourse.AdminFlagsRouteType.extend({ Discourse.AdminFlagsOldRoute = Discourse.AdminFlagsRouteType.extend({
filter: 'old' filter: 'old'
}); });

View file

@ -105,7 +105,7 @@ export default ObjectController.extend(ModalFunctionality, {
changePostActionType: function(action) { changePostActionType: function(action) {
this.set('selected', action); this.set('selected', action);
} },
}, },
canDeleteSpammer: function() { canDeleteSpammer: function() {
@ -118,11 +118,6 @@ export default ObjectController.extend(ModalFunctionality, {
} }
}.property('selected.name_key', 'userDetails.can_be_deleted', 'userDetails.can_delete_all_posts'), }.property('selected.name_key', 'userDetails.can_be_deleted', 'userDetails.can_delete_all_posts'),
deleteSpammer: function() {
this.send('closeModal');
this.get('userDetails').deleteAsSpammer(function() { window.location.reload(); });
},
usernameChanged: function() { usernameChanged: function() {
this.set('userDetails', null); this.set('userDetails', null);
this.fetchUserDetails(); this.fetchUserDetails();