Refactor setting originalTrustLevel to model.
This commit is contained in:
parent
b90a79d40a
commit
c065fad546
|
@ -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');
|
||||
|
|
|
@ -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() {
|
||||
|
|
Loading…
Reference in New Issue