diff --git a/module/product/js/all.js b/module/product/js/all.js index 0b38c9a5e4..37084dd008 100644 --- a/module/product/js/all.js +++ b/module/product/js/all.js @@ -39,14 +39,11 @@ $(function() { setTimeout(function() { - var checkedProduct = true; - $("[id^='productIDList']").each(function() - { - if(!$(this).prop('checked')) checkedProduct = false; - }) + var allCount = $("[id^='productIDList']").length; + var checkedCount = $("[id^='productIDList']:checked").length; - if(checkedProduct) $('.check-all').addClass('checked'); - if(!checkedProduct) $('.check-all').removeClass('checked'); + if(allCount == checkedCount) $('.check-all').addClass('checked'); + if(allCount != checkedCount) $('.check-all').removeClass('checked'); }, 100) }); });