From 2eda2d6350fca756aaa255583dbbb54ccc1fb997 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Sun, 21 Aug 2016 15:06:03 +0200 Subject: [PATCH] (style, opnsense_standard_table_form) reverse zebra to improve heading, drop first grid line When using opnsense_standard_table_form on a table, the first visible row contains a top border (because the invisible mobile border is placed first). The change sets border-top-width on the first td,th to 0px and swaps the zebra printing to keep things more consistent. --- src/www/javascript/opnsense_legacy.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/www/javascript/opnsense_legacy.js b/src/www/javascript/opnsense_legacy.js index 2ab4a9e5a..c91b57369 100644 --- a/src/www/javascript/opnsense_legacy.js +++ b/src/www/javascript/opnsense_legacy.js @@ -110,9 +110,14 @@ function hook_stacked_form_tables(match) root_node.find('tr:visible').each(function () { $(this).css("background-color", "inherit"); $(this).children().css("background-color", "inherit"); - if ( index % 2 == 0) { + if ( index % 2 != 0) { $(this).css("background-color", root_node.data('stripe-color')); } + if (index == 0) { + // hide first visible table grid line + $(this).find('td, th').css('border-top-width', '0px'); + } + // skip generated mobile headers (group header+content on mobile) if (!$(this).hasClass('opnsense-table-mobile-header')) { ++index;