diff --git a/app/assets/javascripts/admin/controllers/admin_badges_controller.js b/app/assets/javascripts/admin/controllers/admin_badges_controller.js index 705aad553..1cf2615ad 100644 --- a/app/assets/javascripts/admin/controllers/admin_badges_controller.js +++ b/app/assets/javascripts/admin/controllers/admin_badges_controller.js @@ -26,6 +26,14 @@ Discourse.AdminBadgesController = Ember.ArrayController.extend({ **/ canEditDescription: Em.computed.none('selectedItem.translatedDescription'), + /** + Disable saving if the currently selected item is being saved. + + @property disableSave + @type {Boolean} + **/ + disableSave: Em.computed.alias('selectedItem.saving'), + actions: { /** @@ -57,11 +65,9 @@ Discourse.AdminBadgesController = Ember.ArrayController.extend({ @method save **/ save: function() { - var badge = this.get('selectedItem'); - badge.set('disableSave', true); - badge.save().then(function() { - badge.set('disableSave', false); - }); + if (!this.get('disableSave')) { + this.get('selectedItem').save(); + } }, /** diff --git a/app/assets/javascripts/admin/templates/badges.js.handlebars b/app/assets/javascripts/admin/templates/badges.js.handlebars index ff39e7418..e11ba2ff7 100644 --- a/app/assets/javascripts/admin/templates/badges.js.handlebars +++ b/app/assets/javascripts/admin/templates/badges.js.handlebars @@ -8,7 +8,7 @@ {{displayName}} {{#if newBadge}} - (*) + ({{i18n filters.new.lower_title}}) {{/if}} @@ -19,7 +19,7 @@ {{#if selectedItem}} {{#with selectedItem}} -