2015-08-11 12:27:07 -04:00
|
|
|
export default Ember.Controller.extend({
|
2013-11-14 12:37:41 -05:00
|
|
|
categoryNameKey: null,
|
2016-10-20 13:26:41 -04:00
|
|
|
adminSiteSettings: Ember.inject.controller(),
|
2013-11-14 12:37:41 -05:00
|
|
|
|
|
|
|
filteredContent: function() {
|
2014-11-26 18:01:45 -05:00
|
|
|
if (!this.get('categoryNameKey')) { return []; }
|
2013-11-14 12:37:41 -05:00
|
|
|
|
2016-10-26 15:44:36 -04:00
|
|
|
const category = (this.get('adminSiteSettings.model') || []).findBy('nameKey', this.get('categoryNameKey'));
|
2013-11-14 12:37:41 -05:00
|
|
|
if (category) {
|
|
|
|
return category.siteSettings;
|
|
|
|
} else {
|
2014-11-26 18:01:45 -05:00
|
|
|
return [];
|
2013-11-14 12:37:41 -05:00
|
|
|
}
|
2016-10-24 11:32:19 -04:00
|
|
|
}.property('adminSiteSettings.model', 'categoryNameKey')
|
2013-11-14 12:37:41 -05:00
|
|
|
|
|
|
|
});
|