discourse/app/assets/javascripts/admin/controllers/admin-customize-themes.js.es6
Osama Sayegh e0cc29d658 FEATURE: themes and components split
* FEATURE: themes and components split

* two seperate methods to switch theme type

* use strict equality operator
2018-08-24 11:30:00 +10:00

20 lines
552 B
JavaScript

import { default as computed } from "ember-addons/ember-computed-decorators";
export default Ember.Controller.extend({
@computed("model", "model.@each", "model.@each.component")
fullThemes(themes) {
return _.sortBy(themes.filter(t => !t.get("component")), t => {
return [
!t.get("default"),
!t.get("user_selectable"),
t.get("name").toLowerCase()
];
});
},
@computed("model", "model.@each", "model.@each.component")
childThemes(themes) {
return themes.filter(t => t.get("component"));
}
});