Use Discourse.computed.setting for more better javascript
This commit is contained in:
parent
a6670c6c83
commit
68fcb66443
|
@ -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);
|
||||
|
|
|
@ -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: {
|
||||
|
||||
|
|
Loading…
Reference in New Issue