discourse/app/assets/javascripts/admin/controllers/admin-customize-themes.js.es6

20 lines
552 B
Plaintext
Raw Normal View History

2018-06-15 23:03:24 +08:00
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 => {
2018-06-15 23:03:24 +08:00
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"));
}
});