This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/assets/javascripts/discourse/raw-views/topic-list-header-column.js.es6
2018-06-15 17:03:24 +02:00

38 lines
725 B
JavaScript

export default Ember.Object.extend({
localizedName: function() {
if (this.forceName) {
return this.forceName;
}
return I18n.t(this.name);
}.property(),
sortIcon: function() {
return "chevron-" + (this.parent.ascending ? "up" : "down");
}.property(),
isSorting: function() {
return this.sortable && this.parent.order === this.order;
}.property(),
className: function() {
var name = [];
if (this.order) {
name.push(this.order);
}
if (this.sortable) {
name.push("sortable");
if (this.get("isSorting")) {
name.push("sorting");
}
}
if (this.number) {
name.push("num");
}
return name.join(" ");
}.property()
});