mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-15 01:23:53 -07:00
Added sorting icons to series table
This commit is contained in:
parent
4cc4e8133e
commit
f8bae13e1c
2 changed files with 52 additions and 8 deletions
|
@ -80,4 +80,40 @@ Backgrid.SeriesIndexTableRow = Backgrid.Row.extend({
|
|||
view: view
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
Backgrid.NzbDroneHeaderCell = Backgrid.HeaderCell.extend({
|
||||
events: {
|
||||
'click': 'onClick'
|
||||
},
|
||||
|
||||
render: function () {
|
||||
this.$el.empty();
|
||||
var test = this.column.get('label');
|
||||
this.$el.append(this.column.get("label"));
|
||||
|
||||
if (this.column.get('sortable')) {
|
||||
this.$el.append(" <i class='icon-sort pull-right'></i>");
|
||||
}
|
||||
this.delegateEvents();
|
||||
return this;
|
||||
},
|
||||
|
||||
direction: function (dir) {
|
||||
if (arguments.length) {
|
||||
if (this._direction) this.$el.children('i').removeClass(this._convertDirectionToIcon(this._direction));
|
||||
if (dir) this.$el.children('i').addClass(this._convertDirectionToIcon(dir));
|
||||
this._direction = dir;
|
||||
}
|
||||
|
||||
return this._direction;
|
||||
},
|
||||
|
||||
_convertDirectionToIcon: function (dir) {
|
||||
if (dir === 'ascending') {
|
||||
return 'icon-sort-up';
|
||||
}
|
||||
|
||||
return 'icon-sort-down';
|
||||
}
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue