Use classes for highlighting to ensure the alternate row colors are not lost when removing a column from the selection.

Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
DL6ER
2020-04-26 21:37:51 +00:00
parent cb3be64a23
commit 6c26852295
3 changed files with 12 additions and 6 deletions

View File

@@ -8,7 +8,6 @@
/* global moment:false */
var tableApi;
var colHighlightColor = "#ffefad";
var tableFilters = [];
var replyTypes = [
@@ -494,13 +493,13 @@ function applyColumnFiltering() {
regex = "^" + value + "$";
// Add background color
tableApi.$("td:eq(" + index + ")").css("background-color", colHighlightColor);
tableApi.$("td:eq(" + index + ")").addClass("filter-highlight");
// Remember to show reset button
showReset = true;
} else {
// Clear background color
tableApi.$("td:eq(" + index + ")").css("background-color", "#fff");
tableApi.$("td:eq(" + index + ")").removeClass("filter-highlight");
}
// Apply filtering on this column (regex may be empty -> no filtering)