mirror of
https://github.com/discourse/discourse.git
synced 2025-09-06 09:10:25 +08:00
- Remove ArrayController - Remove {{view}} from templates - Replace many cases of needs: [‘controller’] with inject - Enable Ember Legacy Views
16 lines
492 B
JavaScript
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')
|
|
|
|
});
|