[FIX] GENERAL: Highlight select delay

This commit is contained in:
Horilla
2023-11-17 11:54:45 +05:30
parent 9a264d49e2
commit 976a65d747

View File

@@ -796,43 +796,11 @@ function emptyChart(chart,args,options) {
}
}
}
function highlightSelected() {
$.each($(".oh-sticky-table__tbody .oh-sticky-table__tr .centered-div [type=checkbox]"), function (indexInArray, checkbox) {
$(checkbox).closest(".oh-sticky-table__tr").removeClass("highlight-selected")
});
$.each($(".oh-sticky-table__tbody .oh-sticky-table__tr .centered-div [type=checkbox]:checked"), function (indexInArray, checkbox) {
$(checkbox).closest(".oh-sticky-table__tr").addClass("highlight-selected")
});
}
$(document).ready(function () {
$("[type=checkbox]").change(function (e) {
highlightSelected()
});
$("div.oh-checkpoint-badge").click(function (e) {
setTimeout(() => {
highlightSelected()
}, 50);
});
});
$(document).on("htmx:afterSwap", function (e) {
setTimeout(() => {
highlightSelected()
}, 210);
$("div.oh-checkpoint-badge").click(function (e) {
setTimeout(() => {
highlightSelected()
}, 100);
});
$("[type=checkbox]").change(function (e) {
setTimeout(() => {
highlightSelected()
}, 100);
});
$("form").submit(function (e) {
setTimeout(() => {
highlightSelected()
}, 100);
});
});
function highlightRow(checkbox) {
checkbox.closest(".oh-sticky-table__tr").removeClass("highlight-selected")
if (checkbox.is(":checked")) {
checkbox.closest(".oh-sticky-table__tr").addClass("highlight-selected")
}
}
</script>