REFACTOR: topic-list-header-column (#7099)

This commit is contained in:
Joffrey JAFFEUX 2019-03-04 04:45:52 +01:00 committed by Sam
parent 01e2180548
commit bb39a6f7d7

View File

@ -1,25 +1,34 @@
import { default as computed } from "ember-addons/ember-computed-decorators";
export default Ember.Object.extend({
localizedName: function() {
@computed
localizedName() {
if (this.forceName) {
return this.forceName;
}
return this.name ? I18n.t(this.name) : "";
}.property(),
},
sortIcon: function() {
return "chevron-" + (this.parent.ascending ? "up" : "down");
}.property(),
@computed
sortIcon() {
const asc = this.parent.ascending ? "up" : "down";
return `chevron-${asc}`;
},
isSorting: function() {
@computed
isSorting() {
return this.sortable && this.parent.order === this.order;
}.property(),
},
@computed
className() {
const name = [];
className: function() {
var name = [];
if (this.order) {
name.push(this.order);
}
if (this.sortable) {
name.push("sortable");
@ -33,5 +42,5 @@ export default Ember.Object.extend({
}
return name.join(" ");
}.property()
}
});