2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-06 09:10:25 +08:00
discourse/app/assets/javascripts/admin/controllers/admin-site-settings-category.js.es6
Robin Ward bf91532260 Fixes some Ember Deprecations for 1.13:
- Remove ArrayController
- Remove {{view}} from templates
- Replace many cases of needs: [‘controller’] with inject
- Enable Ember Legacy Views
2016-10-21 11:06:07 -04:00

16 lines
492 B
JavaScript

export default Ember.Controller.extend({
categoryNameKey: null,
adminSiteSettings: Ember.inject.controller(),
filteredContent: function() {
if (!this.get('categoryNameKey')) { return []; }
const category = this.get('adminSiteSettings.allSiteSettings').findProperty('nameKey', this.get('categoryNameKey'));
if (category) {
return category.siteSettings;
} else {
return [];
}
}.property('controllers.adminSiteSettings.content', 'categoryNameKey')
});