From 97b26856253df35a8ee04e1f4d2f29734116687f Mon Sep 17 00:00:00 2001 From: leebj Date: Thu, 1 Aug 2024 14:46:19 +0900 Subject: [PATCH] =?UTF-8?q?=EB=82=A9=EB=B6=80=EC=9E=90=EB=B2=88=ED=98=B8?= =?UTF-8?q?=20=EB=B3=B5=EC=82=AC=20=ED=95=A8=EC=88=98=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WEB-INF/jsp/fims/sprt/sprt01010-main.jsp | 14 +------------- .../resources/js/fims/cmmn/fims-cmmnUtil.js | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt01010-main.jsp b/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt01010-main.jsp index 25434a90..bf3a7c67 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt01010-main.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt01010-main.jsp @@ -379,19 +379,7 @@ $(document).ready(function() { } if(cur != null){ - - if(window.isSecureContext){ - navigator.clipboard.writeText(cur.RTPYR_NO); - } else { - var textArea = document.createElement("textarea"); - textArea.style.position = "fixed"; - textArea.value = cur.RTPYR_NO; - document.body.appendChild(textArea); - textArea.focus(); - textArea.select(); - document.execCommand('copy'); - document.body.removeChild(textArea); - } + clipboardCopy(cur.RTPYR_NO); $("#toastText--${pageName}").html("납부자번호가 복사되었습니다."); $P.toast.show(); diff --git a/src/main/webapp/resources/js/fims/cmmn/fims-cmmnUtil.js b/src/main/webapp/resources/js/fims/cmmn/fims-cmmnUtil.js index cc89dd57..48b35337 100644 --- a/src/main/webapp/resources/js/fims/cmmn/fims-cmmnUtil.js +++ b/src/main/webapp/resources/js/fims/cmmn/fims-cmmnUtil.js @@ -1,3 +1,21 @@ +/************************************************************************** +* 클립보드 복사 +**************************************************************************/ +function clipboardCopy(string){ + if(window.isSecureContext){ + navigator.clipboard.writeText(string); + } else { + var textArea = document.createElement("textarea"); + textArea.style.position = "fixed"; + textArea.value = string; + document.body.appendChild(textArea); + textArea.focus(); + textArea.select(); + document.execCommand('copy'); + document.body.removeChild(textArea); + } +} + /************************************************************************** * pdf파일 미리보기 창 **************************************************************************/