mirror of
https://github.com/discourse/discourse.git
synced 2025-03-25 08:55:46 +08:00
REFACTOR: topic-list-header-column (#7099)
This commit is contained in:
parent
01e2180548
commit
bb39a6f7d7
@ -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()
|
||||
}
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user