Add border JS to duplicate review

This commit is contained in:
Deon George 2024-10-07 21:23:43 +11:00
parent 952bb1e38e
commit 6208aa3336

View File

@ -85,6 +85,48 @@
swap($(this));
scroll($(this));
});
$('input[type="checkbox"]').on('click',function(item) {
var card = $(this).closest('div').parent();
switch ($(this).data('name')) {
case 'duplicate':
if (card.hasClass('border-success')) {
card.removeClass('border-success').addClass('border-light');
break;
} else if (card.hasClass('border-danger')) {
// Do nothing
} else {
card.toggleClass('border-light');
}
break;
case 'remove':
if ($(this).is(':checked')) {
if (card.hasClass('border-light'))
card.removeClass('border-light');
else
card.removeClass('border-success');
card.addClass('border-danger');
} else {
if (card.hasClass('border-danger')) {
card.removeClass('border-danger');
}
if ($(this).closest('tr').parent().find('input[name^="duplicate"]').is(':checked'))
card.addClass('border-light')
else
card.addClass('border-success');
}
break;
}
})
});
</script>
@append