FEATURE: themes and components split

* FEATURE: themes and components split

* two seperate methods to switch theme type

* use strict equality operator
This commit is contained in:
Osama Sayegh
2018-08-24 04:30:00 +03:00
committed by Sam
parent 4a552fb967
commit e0cc29d658
29 changed files with 445 additions and 157 deletions

View File

@ -1,14 +1,19 @@
import { default as computed } from "ember-addons/ember-computed-decorators";
export default Ember.Controller.extend({
@computed("model", "model.@each")
sortedThemes(themes) {
return _.sortBy(themes.content, t => {
@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"));
}
});