mirror of
https://github.com/discourse/discourse.git
synced 2025-02-16 22:02:45 +08:00
19 lines
590 B
Plaintext
19 lines
590 B
Plaintext
![]() |
import computed from "ember-addons/ember-computed-decorators";
|
||
|
|
||
|
export default Ember.Component.extend({
|
||
|
tagName: "th",
|
||
|
classNames: ["admin-report-table-header"],
|
||
|
classNameBindings: ["label.property", "isCurrentSort"],
|
||
|
attributeBindings: ["label.title:title"],
|
||
|
|
||
|
@computed("currentSortLabel.sort_property", "label.sort_property")
|
||
|
isCurrentSort(currentSortField, labelSortField) {
|
||
|
return currentSortField === labelSortField;
|
||
|
},
|
||
|
|
||
|
@computed("currentSortDirection")
|
||
|
sortIcon(currentSortDirection) {
|
||
|
return currentSortDirection === 1 ? "caret-up" : "caret-down";
|
||
|
}
|
||
|
});
|