diff --git a/resources/views/catalog/duplicatereview.blade.php b/resources/views/catalog/duplicatereview.blade.php index 2844cdb..4f789a1 100644 --- a/resources/views/catalog/duplicatereview.blade.php +++ b/resources/views/catalog/duplicatereview.blade.php @@ -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; + } + }) }); @append \ No newline at end of file