From 0b6d5c662a3673c2b63ce60bb735f70ff9ef8304 Mon Sep 17 00:00:00 2001 From: Gabriele Date: Tue, 11 Nov 2014 15:26:20 +0100 Subject: [PATCH] WebUI: Use CSS to alternate row colors in transferlist Keep the old code for IE < 9, the majority of the browsers shouldn't need it. Also, keep the CSS code in one place. --- src/webui/www/public/css/dynamicTable.css | 4 ++++ src/webui/www/public/css/style.css | 9 --------- src/webui/www/public/scripts/dynamicTable.js | 3 +++ 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/webui/www/public/css/dynamicTable.css b/src/webui/www/public/css/dynamicTable.css index 0a9583f23..bbe4eb89a 100644 --- a/src/webui/www/public/css/dynamicTable.css +++ b/src/webui/www/public/css/dynamicTable.css @@ -29,6 +29,8 @@ } +#myTable tr:nth-child(even), +#filesTable tr:nth-child(even), #properties #torrentFiles tr.alt, #properties #trackers tr.alt, #transferList tr.alt { @@ -49,6 +51,8 @@ color: #fff; } +#myTable tr:hover, +#filesTable tr:hover, #properties #torrentFiles tr.over, #properties #trackers tr.over, #transferList tr.over { diff --git a/src/webui/www/public/css/style.css b/src/webui/www/public/css/style.css index aae22b6da..aac6523b5 100644 --- a/src/webui/www/public/css/style.css +++ b/src/webui/www/public/css/style.css @@ -350,15 +350,6 @@ ul.filterList li:hover a { line-height: 20px; } -#filesTable tr:nth-child(even) { - background-color: #eee; -} - -#filesTable tr:hover { - background-color: #e60; - color: white; -} - #addTrackersPlus { width: 16px; cursor: pointer; diff --git a/src/webui/www/public/scripts/dynamicTable.js b/src/webui/www/public/scripts/dynamicTable.js index 4ae397fd2..b1687b04f 100644 --- a/src/webui/www/public/scripts/dynamicTable.js +++ b/src/webui/www/public/scripts/dynamicTable.js @@ -63,6 +63,9 @@ var dynamicTable = new Class({ }, altRow : function () { + if (!MUI.ieLegacySupport) + return; + var trs = this.table.getElements('tr'); trs.each(function (el, i) { if (i % 2) {