Use Discourse.computed.setting for more better javascript

This commit is contained in:
Neil Lalonde 2014-05-16 15:27:42 -04:00
parent a6670c6c83
commit 68fcb66443
2 changed files with 3 additions and 6 deletions

View File

@ -32,9 +32,8 @@ export default Discourse.DiscoveryController.extend({
return Discourse.User.currentProp('staff');
}.property(),
canOrder: function() {
return this.get('canEdit') && Discourse.SiteSettings.fixed_category_positions;
}.property('Discourse.SiteSettings.fixed_category_positions'),
fixedCategoryPositions: Discourse.computed.setting('fixed_category_positions'),
canOrder: Em.computed.and('fixedCategoryPositions', 'canEdit'),
moveCategory: function(categoryId, position){
this.get('model.categories').moveCategory(categoryId, position);

View File

@ -114,9 +114,7 @@ export default Discourse.ObjectController.extend(Discourse.ModalFunctionality, {
return !this.get('isUncategorized') && this.get('id');
}.property('isUncategorized', 'id'),
showPositionInput: function() {
return Discourse.SiteSettings.fixed_category_positions;
}.property('Discourse.SiteSettings.fixed_category_positions'),
showPositionInput: Discourse.computed.setting('fixed_category_positions'),
actions: {