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
+5 -2
View File
@@ -155,8 +155,11 @@ if(strlen($showing) > 0)
</tr>
</tfoot>
</table>
<label>Apply filtering on click on Query type, Domain, and Clients (use <kbd>Ctrl</kbd> or <kbd>&#8984;</kbd> + <i class="fas fa-mouse-pointer"></i> to add elements to the current selection)</label><br/>
<button type="button" id="resetButton" hidden="true"></button>
<label>Filtering options:</label>
<ul>
<li>Use <kbd>Ctrl</kbd> or <kbd>&#8984;</kbd> + <i class="fas fa-mouse-pointer"></i> to add columns to the current filter</li>
<li>Use <kbd>Shift</kbd> + <i class="fas fa-mouse-pointer"></i> to remove columns to the current filter</li>
</ul><br/><button type="button" id="resetButton" hidden="true"></button>
</div>
<!-- /.box-body -->
</div>
+2 -3
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)
+5 -1
View File
@@ -265,4 +265,8 @@ code.breakall
.bootstrap-select.bs-container.align-right {
left: unset !important;
right: 10px;
}
}
.filter-highlight {
background-color: #ffcc0050;
}