From db784313b8ba29f5d4396c1cc96bb5f3c853677f Mon Sep 17 00:00:00 2001 From: Ram Krishna Verma Date: Fri, 27 Aug 2021 16:11:39 -0400 Subject: Fix sonar issues in policy/gui Issue-ID: POLICY-3077 Change-Id: Idcd08427cbff2cfdd8ba99db7cf32a0f5c978415 Signed-off-by: Ram Krishna Verma --- .../src/main/resources/webapp/js/dropdownList.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'gui-editors/gui-editor-apex/src/main/resources/webapp/js/dropdownList.js') diff --git a/gui-editors/gui-editor-apex/src/main/resources/webapp/js/dropdownList.js b/gui-editors/gui-editor-apex/src/main/resources/webapp/js/dropdownList.js index 3657fd4..d18b38e 100644 --- a/gui-editors/gui-editor-apex/src/main/resources/webapp/js/dropdownList.js +++ b/gui-editors/gui-editor-apex/src/main/resources/webapp/js/dropdownList.js @@ -2,6 +2,7 @@ * ============LICENSE_START======================================================= * Copyright (C) 2016-2018 Ericsson. All rights reserved. * Modifications Copyright (C) 2020-2021 Nordix Foundation. + * Modifications Copyright (C) 2021 Bell Canada. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -60,11 +61,11 @@ function dropdownList_filter(optionDiv, optionUl) { ul = document.getElementById(optionDiv + "_options_list_ul"); var lis = ul.querySelectorAll("#" + ul.id + " > li"); // get li direct // child elements - for (var i = 0; i < lis.length; i++) { - if (lis[i].innerHTML.toUpperCase().indexOf(filter) > -1) { - lis[i].style.display = ""; + for (let value of lis) { + if (value.innerHTML.toUpperCase().indexOf(filter) > -1) { + value.style.display = ""; } else { - lis[i].style.display = "none"; + value.style.display = "none"; } } } @@ -123,8 +124,8 @@ function dropdownList_ChangeOptions(dropdownListDIV, options, selected, disabled // that // are // divs - for (var d = 0; d < subdivs.length; d++) { - retdiv.removeChild(subdivs[d]); + for (let value of subdivs) { + retdiv.removeChild(value); } var onselect = null; if (retdiv["_dropDownList_listener"]) { -- cgit 1.2.3-korg