From e50563c79c82a9600b790e25df4e1714e7ba514f Mon Sep 17 00:00:00 2001 From: Phil Ringnalda Date: Sat, 12 Apr 2025 12:09:29 -0700 Subject: [PATCH] Bug 39464: Grey rows in tables not highlighting in yellow when they should Because the CSS rule for turning odd-numbered rows grey is highly-specific (tbody tr:nth-child(2n+1):not(.dtrg-group, .active, .ok) td:not(.bg-danger, .bg-warning, .bg-info, .bg-success, .bg-primary)), it overrides the .highlighted-row, .highlighted-row td rule that some tables use to turn the background of a currently-selected row yellow, so highlighted-row needs to be added to the lists of not(). Test plan: 1. Without the patch, Cataloging - New from Z39.50/SRU, perform a search like Author smith which will return at least two results. 2. On an even-numbered row with a white background, click MARC and note that the row is given a yellow background (either by increasing the size of the popup to peer around the preview, or by closing the preview, since the highlight persists). 3. On an odd-numbered row with a grey background, click MARC and note that the row isn't given a yellow background 4. Administration - Circulation and fine rules, if you don't already have at least two rules add one by just changing the Patron category in the edit row and Save 5. On a row with a white background, click Edit and note that the background for that row is yellow 6. On a row with a grey background, click Edit and note that the background remains grey, not yellow 7. Apply patch, in ktd --shell yarn build (or in a sandbox Actions - Build CSS and JS), clear browser cache or shift+Reload the page 8. Repeat steps 1-6, but this time note that you get the same yellow highlighted background for both odd and even rows. Signed-off-by: Magnus Enger Signed-off-by: David Nind Signed-off-by: Lucas Gass --- koha-tmpl/intranet-tmpl/prog/css/src/_tables.scss | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/css/src/_tables.scss b/koha-tmpl/intranet-tmpl/prog/css/src/_tables.scss index 7927c8841da..8720f3b449c 100644 --- a/koha-tmpl/intranet-tmpl/prog/css/src/_tables.scss +++ b/koha-tmpl/intranet-tmpl/prog/css/src/_tables.scss @@ -410,9 +410,9 @@ caption { tbody { tr { - &:nth-child( odd ):not( .dtrg-group, .active, .ok ) { + &:nth-child( odd ):not( .dtrg-group, .active, .ok, .highlighted-row ) { td { - &:not( .bg-danger, .bg-warning, .bg-info, .bg-success, .bg-primary ) { + &:not( .bg-danger, .bg-warning, .bg-info, .bg-success, .bg-primary, .highlighted-row ) { background-color: $table-odd-row; } } -- 2.39.5