mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-24 08:09:13 -05:00
Refactor setting originalTrustLevel to model.
This commit is contained in:
parent
b90a79d40a
commit
c065fad546
2 changed files with 5 additions and 1 deletions
|
@ -67,6 +67,10 @@ Discourse.AdminUser = Discourse.User.extend({
|
||||||
return site.get('trust_levels').findProperty('id', this.get('trust_level'));
|
return site.get('trust_levels').findProperty('id', this.get('trust_level'));
|
||||||
}.property('trust_level'),
|
}.property('trust_level'),
|
||||||
|
|
||||||
|
setOriginalTrustLevel: function() {
|
||||||
|
this.set('originalTrustLevel', this.get('trust_level'));
|
||||||
|
},
|
||||||
|
|
||||||
trustLevels: function() {
|
trustLevels: function() {
|
||||||
var site = Discourse.Site.instance();
|
var site = Discourse.Site.instance();
|
||||||
return site.get('trust_levels');
|
return site.get('trust_levels');
|
||||||
|
|
|
@ -18,7 +18,7 @@ Discourse.AdminUserRoute = Discourse.Route.extend(Discourse.ModelReady, {
|
||||||
|
|
||||||
setupController: function(controller, model) {
|
setupController: function(controller, model) {
|
||||||
controller.set('model', model);
|
controller.set('model', model);
|
||||||
controller.set('originalTrustLevel', model.trust_level);
|
model.setOriginalTrustLevel();
|
||||||
},
|
},
|
||||||
|
|
||||||
renderTemplate: function() {
|
renderTemplate: function() {
|
||||||
|
|
Loading…
Reference in a new issue