Refactor setting originalTrustLevel to model.

This commit is contained in:
Navin 2013-07-04 13:01:01 +02:00
parent b90a79d40a
commit c065fad546
2 changed files with 5 additions and 1 deletions

View File

@ -67,6 +67,10 @@ Discourse.AdminUser = Discourse.User.extend({
return site.get('trust_levels').findProperty('id', this.get('trust_level'));
}.property('trust_level'),
setOriginalTrustLevel: function() {
this.set('originalTrustLevel', this.get('trust_level'));
},
trustLevels: function() {
var site = Discourse.Site.instance();
return site.get('trust_levels');

View File

@ -18,7 +18,7 @@ Discourse.AdminUserRoute = Discourse.Route.extend(Discourse.ModelReady, {
setupController: function(controller, model) {
controller.set('model', model);
controller.set('originalTrustLevel', model.trust_level);
model.setOriginalTrustLevel();
},
renderTemplate: function() {