mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-21 14:03:29 -07:00
DataTables added for use on History Grid.
This commit is contained in:
parent
e42f0222dc
commit
6ffc429ae0
254 changed files with 154683 additions and 56 deletions
|
@ -1,5 +1,5 @@
|
|||
/* Click on row, show details */
|
||||
$('.seriesTable a').live('click', function (event) {
|
||||
$('.seriesTable a, .dataTable a').live('click', function (event) {
|
||||
if ($(this).attr('onclick'))
|
||||
return;
|
||||
|
||||
|
@ -18,21 +18,25 @@ function grid_onError(e) {
|
|||
e.preventDefault();
|
||||
}
|
||||
|
||||
//Highlight rows based on a number of details
|
||||
function highlightRow(e) {
|
||||
var row = e.row;
|
||||
var dataItem = e.dataItem;
|
||||
//Perform the details opening
|
||||
var oTable;
|
||||
|
||||
var ignored = dataItem.Ignored;
|
||||
var status = dataItem.Status;
|
||||
$('.dataTable td:not(:last-child)').live('click', function () {
|
||||
var nTr = this.parentNode;
|
||||
|
||||
if (ignored) {
|
||||
$(row).addClass('episodeIgnored');
|
||||
return;
|
||||
if ($(nTr).hasClass('details-opened')) {
|
||||
oTable.fnClose(nTr);
|
||||
$(nTr).removeClass('details-opened');
|
||||
}
|
||||
|
||||
if (status == "Missing") {
|
||||
$(row).addClass('episodeMissing');
|
||||
return;
|
||||
else {
|
||||
oTable.fnOpen(nTr, fnFormatDetails(oTable, nTr), 'Details');
|
||||
$(nTr).addClass('details-opened');
|
||||
}
|
||||
});
|
||||
|
||||
//Datatables format display details
|
||||
function fnFormatDetails(oTable, nTr) {
|
||||
var aData = oTable.fnGetData(nTr);
|
||||
return aData[aData.length - 1];
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue