From 1919376ad4ee2a01c8262da9ff318f7adb96d744 Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Tue, 19 Nov 2013 02:58:15 +0000 Subject: Fix background color of selected rows using css and classes to work with tablesorter --- weblog-viewweblog-html.lsp | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) (limited to 'weblog-viewweblog-html.lsp') diff --git a/weblog-viewweblog-html.lsp b/weblog-viewweblog-html.lsp index 4d7a81d..b9bd092 100644 --- a/weblog-viewweblog-html.lsp +++ b/weblog-viewweblog-html.lsp @@ -49,12 +49,10 @@ end array.push(this.id); }); if (this.checked == false) { - $('.chktbl:checked').prop('checked', false); - $("#loglist").find('tr:not(#chktbl)').css("background-color","#FFF"); + $('.chktbl:checked').prop('checked', false).closest('tr').removeClass("selected"); deselectdata = array.join("%0D%0A"); } else { - $('.chktbl:not(:checked)').prop('checked', true); - $("#loglist").find('tr:not(#chktbl)').css("background-color","#FC9A01"); + $('.chktbl:not(:checked)').prop('checked', true).closest('tr').addClass("selected"); selectdata = array.join("%0D%0A"); } $.getJSON( @@ -67,12 +65,12 @@ end var selectdata = ""; var deselectdata = ""; if (this.checked == true) { - $(this).closest('tr').css("background-color","#FC9A01"); + $(this).closest('tr').addClass("selected"); selectdata = this.id; } else { // If clearing, clear the Head too $("#chkHead").prop("checked", false); - $(this).closest('tr').css("background-color","#ffffff"); + $(this).closest('tr').removeClass("selected"); deselectdata = this.id; } $.getJSON( @@ -100,8 +98,26 @@ end #content table { border-collapse: collapse; width: 100%; } #content table td { border-bottom: none; white-space: normal; padding-right:20px; } #content table th { border-bottom: none; white-space: normal; vertical-align: middle; padding-right:15px } - #content table tr.mark { background: #E9E9E9; } - #content table tr.selected { background: #FC9A01; } +.tablesorter-blue tbody > tr.even.selected > td, +.tablesorter-blue tbody > tr.even.selected + tr.tablesorter-childRow > td, +.tablesorter-blue tbody > tr.even.selected + tr.tablesorter-childRow + tr.tablesorter-childRow > td { + background: #FDAD31; +} +.tablesorter-blue tbody > tr.odd.selected > td, +.tablesorter-blue tbody > tr.odd.selected + tr.tablesorter-childRow > td, +.tablesorter-blue tbody > tr.odd.selected + tr.tablesorter-childRow + tr.tablesorter-childRow > td { + background: #FC9A01; +} +.tablesorter-blue tbody > tr.even.selected:hover > td, +.tablesorter-blue tbody > tr.even.selected:hover + tr.tablesorter-childRow > td, +.tablesorter-blue tbody > tr.even.selected:hover + tr.tablesorter-childRow + tr.tablesorter-childRow > td { + background: #D48101; +} +.tablesorter-blue tbody > tr.odd.selected:hover > td, +.tablesorter-blue tbody > tr.odd.selected:hover + tr.tablesorter-childRow > td, +.tablesorter-blue tbody > tr.odd.selected:hover + tr.tablesorter-childRow + tr.tablesorter-childRow > td { + background: #CA7B01; +}

Search Parameters

@@ -162,7 +178,6 @@ end %> <% for i,watch in ipairs(subdata) do local a,b = math.modf((i/2)) local mark = '' - if (b == 0) and watch.selected ~= "t" then mark=' class="mark"' end if watch.selected == "t" then mark=' class="selected"' end local time = {} time.year, time.month, time.day, time.hour, time.min, time.sec = -- cgit v1.2.3