This is an automated email from the ASF dual-hosted git repository. adityasharma pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/roller.git
commit 793310ab4d7a96875522f913f172e98713b96c6d Author: Aditya Sharma <adityasha...@apache.org> AuthorDate: Mon Jan 4 18:38:29 2021 +0530 Fixed: sonarqube issue - 'toggle' is already declared in the upper scope Variables should not be shadowed Changed the name of variable instead of changing declaration in upper scope to avoid any code failure --- app/src/main/webapp/theme/scripts/roller.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/webapp/theme/scripts/roller.js b/app/src/main/webapp/theme/scripts/roller.js index ef85d10..1685b76 100644 --- a/app/src/main/webapp/theme/scripts/roller.js +++ b/app/src/main/webapp/theme/scripts/roller.js @@ -181,24 +181,24 @@ function isblank(s) { window.defaultStatus=document.title; // Toggle check boxes -function toggleFunctionAll(toggle) { +function toggleFunctionAll(toggleValue) { var inputs = document.getElementsByTagName('input'); for(var i = 0; i < inputs.length ; i++) { if(inputs[i].name !== "control" && inputs[i].type === 'checkbox' && inputs[i].disabled === false ) { if (inputs[i].checked === true){ inputs[i].checked = !inputs[i].checked; } else{ - inputs[i].checked = toggle; + inputs[i].checked = toggleValue; } } } } -function toggleFunction(toggle,name) {; +function toggleFunction(toggleValue,name) { var inputs = document.getElementsByName(name); for(var i = 0; i < inputs.length ; i++) { if(inputs[i].type === 'checkbox' && inputs[i].disabled === false) { - inputs[i].checked = toggle; + inputs[i].checked = toggleValue; } } }