mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-12-01 03:17:53 -05:00
38 lines
719 B
JavaScript
38 lines
719 B
JavaScript
export default Ember.Object.extend({
|
|
|
|
localizedName: function(){
|
|
if(this.forceName){
|
|
return this.forceName;
|
|
}
|
|
|
|
return I18n.t(this.name);
|
|
}.property(),
|
|
|
|
sortClass: function(){
|
|
return "fa fa-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()
|
|
});
|