From 8c81591418dbb9cd757b0050122d3b9d9f07ef9c Mon Sep 17 00:00:00 2001 From: "Jonguk. Lim" Date: Sat, 29 Jun 2024 22:12:46 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20var=20->=20let=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jsp/adds/nims/dsuseMgtRslt-info.jsp | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/src/main/webapp/WEB-INF/jsp/adds/nims/dsuseMgtRslt-info.jsp b/src/main/webapp/WEB-INF/jsp/adds/nims/dsuseMgtRslt-info.jsp index 987365f..8b59260 100644 --- a/src/main/webapp/WEB-INF/jsp/adds/nims/dsuseMgtRslt-info.jsp +++ b/src/main/webapp/WEB-INF/jsp/adds/nims/dsuseMgtRslt-info.jsp @@ -85,7 +85,8 @@
    - +<%--
      --%> +
@@ -328,7 +329,7 @@ $P.fnDisplay = () => { if($P.fileArr.length > 0){ - var tagsText = $P.fnMakeImgTags($P.fileArr); + let tagsText = $P.fnMakeImgTags($P.fileArr); document.querySelector("#dragAndDrop--${pageName}").innerHTML = tagsText; $("#btnImageDel--${pageName}").removeAttr("hidden"); } else { @@ -340,18 +341,16 @@ // HTML 태그(img,checkbox) 문자열 생성 $P.fnMakeImgTags = (fileArr) => { - var tagsTextArr = []; + let tagsTextArr = []; - for(var index = 0; index < fileArr.length; index++){ - var item = fileArr[index]; + for(let index = 0; index < fileArr.length; index++){ + let item = fileArr[index]; - var template = document.getElementById("imgCheckboxTemplate--${pageName}").innerHTML; + let template = document.getElementById("imgCheckboxTemplate--${pageName}").innerHTML; template = template.replace(/{name}/gi, "dsuseDsuseImgFilesSelector"); template = template.replace(/{value}/gi, item.id); - template = template.replace(/{src}/gi, item.url); - tagsTextArr.push(template); } @@ -414,14 +413,14 @@ //이미지 삭제 버튼 $("#btnImageDel--${pageName}").on("click", function() { - var checkeds = $("#dragAndDrop--${pageName}").find(":checkbox[name='dsuseDsuseImgFilesSelector']:checked"); + let checkeds = $("#dragAndDrop--${pageName}").find(":checkbox[name='dsuseDsuseImgFilesSelector']:checked"); if(checkeds.length > 0){ - var keys = []; + let keys = []; checkeds.each(function(){ keys.push(this.value); }); - $P.fileArr = $P.fileArr.filter((element) => keys.indexOf(element.id) == -1); + $P.fileArr = $P.fileArr.filter((element) => keys.indexOf(element.id) === -1); $P.fnDisplay(); } });