diff --git a/app/assets/javascripts/lib/items/items.js.erb b/app/assets/javascripts/lib/items/items.js.erb index 090f86f6d..ac0afba4d 100644 --- a/app/assets/javascripts/lib/items/items.js.erb +++ b/app/assets/javascripts/lib/items/items.js.erb @@ -411,7 +411,7 @@ $(function() { $pageCategory.find('input[type="checkbox"]').eq(index).prop('checked', true); } var $all = $pageCategory.siblings('.checkbox').children('.select_all'); - _val == _select.main && _select.category.length ? $hiddenInputA.removeAttr('name') : $hiddenInputA.attr('name', 'page[category][]'); + _boolean && _val == _select.main && _select.category.length ? $hiddenInputA.removeAttr('name') : $hiddenInputA.attr('name', 'page[category][]'); _boolean && _val == _select.main && _select.category.length == index + 1 ? $all.prop('checked', true) : $all.prop('checked', false); } }); @@ -431,7 +431,7 @@ $(function() { $pageTags.find('input[type="checkbox"]').eq(index).prop('checked', true); } var $all = $pageTags.siblings('.checkbox').children('.select_all'); - _val == _select.main && _select.tags.length ? $hiddenInputB.removeAttr('name') : $hiddenInputB.attr('name', 'page[tag][]'); + _boolean && _val == _select.main && _select.tags.length ? $hiddenInputB.removeAttr('name') : $hiddenInputB.attr('name', 'page[tag][]'); _boolean && _val == _select.main && _select.tags.length == index + 1 ? $all.prop('checked', true) : $all.prop('checked', false); } });