From 8fa2fd886e5afdff6ab58ee85830e380f771b04d Mon Sep 17 00:00:00 2001 From: Rayden <rb.ridene@gmail.com> Date: Wed, 23 May 2018 10:40:52 +0200 Subject: [PATCH] fix(js): fix select all action on listing (#6297) * fix(js): fix select all action on listing refs: #6193 * Update tool.js * fix(js): improve check all code --- www/include/common/javascript/tool.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/www/include/common/javascript/tool.js b/www/include/common/javascript/tool.js index f77300061d..ecaaf625bd 100644 --- a/www/include/common/javascript/tool.js +++ b/www/include/common/javascript/tool.js @@ -140,13 +140,16 @@ function toggleDisplay(id) function checkUncheckAll(theElement) { jQuery(theElement).parents('tr').nextAll().find('input[type=checkbox]').each(function() { + if (theElement.checked && !jQuery(this).attr('checked')) { - jQuery(this).attr('checked',true); + jQuery(this).attr("checked",true).prop("checked", true); + if (typeof(_selectedElem) != 'undefined') { putInSelectedElem(jQuery(this).attr('id')); } } else if (!theElement.checked && jQuery(this).attr('checked')) { - jQuery(this).attr('checked', false); + jQuery(this).attr("checked", false).prop("checked", false); + if (typeof(_selectedElem) != 'undefined') { removeFromSelectedElem(jQuery(this).attr('id')); } -- GitLab