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파일 미리보기 창 **************************************************************************/