mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
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');
|
return Discourse.User.currentProp('staff');
|
||||||
}.property(),
|
}.property(),
|
||||||
|
|
||||||
canOrder: function() {
|
fixedCategoryPositions: Discourse.computed.setting('fixed_category_positions'),
|
||||||
return this.get('canEdit') && Discourse.SiteSettings.fixed_category_positions;
|
canOrder: Em.computed.and('fixedCategoryPositions', 'canEdit'),
|
||||||
}.property('Discourse.SiteSettings.fixed_category_positions'),
|
|
||||||
|
|
||||||
moveCategory: function(categoryId, position){
|
moveCategory: function(categoryId, position){
|
||||||
this.get('model.categories').moveCategory(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');
|
return !this.get('isUncategorized') && this.get('id');
|
||||||
}.property('isUncategorized', 'id'),
|
}.property('isUncategorized', 'id'),
|
||||||
|
|
||||||
showPositionInput: function() {
|
showPositionInput: Discourse.computed.setting('fixed_category_positions'),
|
||||||
return Discourse.SiteSettings.fixed_category_positions;
|
|
||||||
}.property('Discourse.SiteSettings.fixed_category_positions'),
|
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user