diff --git a/front/src/main/resources/static/ui/commonUtil.js b/front/src/main/resources/static/ui/commonUtil.js index 5650cf54..2b823a29 100644 --- a/front/src/main/resources/static/ui/commonUtil.js +++ b/front/src/main/resources/static/ui/commonUtil.js @@ -347,4 +347,13 @@ kri.form.setSelectBoxUiCode = function({ getParentValue: () => parentSelectUI.getValue(), getChildValue: () => childSelectUI?.getValue() ?? '' }; -} \ No newline at end of file +} + +$(window).off('hashchange.modalClose').on('hashchange.modalClose', function() { + if (window.location.hash !== '#modal-open') { + const modal01 = document.querySelector(ENV.modal.selector)?.ui; + if (modal01) { + modal01.close(); + } + } +}); \ No newline at end of file diff --git a/front/src/main/resources/static/ui/page/daily-record.js b/front/src/main/resources/static/ui/page/daily-record.js index b5347fe0..ea260df3 100644 --- a/front/src/main/resources/static/ui/page/daily-record.js +++ b/front/src/main/resources/static/ui/page/daily-record.js @@ -127,8 +127,11 @@ krip.daily.createModal = function(id) { const modal01 = document.querySelector(ENV.modal.selector).ui; modal01.open(); + // URL 해시 추가 + window.location.hash = 'modal-open'; modalControl._bindModelUI(); + }, function(code, rstData) { kri.logger.error('Do nothing. code: '+ code, rstData); diff --git a/front/src/main/resources/templates/info/bank/input.html b/front/src/main/resources/templates/info/bank/input.html index e2aec841..83034e4f 100644 --- a/front/src/main/resources/templates/info/bank/input.html +++ b/front/src/main/resources/templates/info/bank/input.html @@ -112,6 +112,10 @@ module: { modalPopup: null }, + modal: { + // 등록 영역 + selector: '.addPopup', + }, data: { transferCategoryCodeList: /*[[${transferCategoryList}]]*/ [], codeRecordCropList: /*[[${codeRecordCropList}]]*/ [], @@ -339,6 +343,7 @@ }); ENV.module.modalPopup.open(); + window.location.hash = 'modal-open'; document.querySelector('.modal-content').scrollTop = 0; diff --git a/front/src/main/resources/templates/info/bank/output.html b/front/src/main/resources/templates/info/bank/output.html index 5a51a527..43eb9b9a 100644 --- a/front/src/main/resources/templates/info/bank/output.html +++ b/front/src/main/resources/templates/info/bank/output.html @@ -112,6 +112,10 @@ module: { modalPopup: null }, + modal: { + // 등록 영역 + selector: '.addPopup', + }, data: { transferCategoryCodeList: /*[[${transferCategoryList}]]*/ [], codeRecordCropList: /*[[${codeRecordCropList}]]*/ [], @@ -330,6 +334,7 @@ }); ENV.module.modalPopup.open(); + window.location.hash = 'modal-open'; document.querySelector('.modal-content').scrollTop = 0; // 모두 로드된 후 콜백 실행 diff --git a/front/src/main/resources/templates/info/monthly/{id}.html b/front/src/main/resources/templates/info/monthly/{id}.html index 90e16c6e..e84a7e23 100644 --- a/front/src/main/resources/templates/info/monthly/{id}.html +++ b/front/src/main/resources/templates/info/monthly/{id}.html @@ -108,7 +108,10 @@ module: { modalPopup: null }, - + modal: { + // 등록 영역 + selector: '.addPopup', + }, data: { purposeList: /*[[${purposeList}]]*/ [], unitList: /*[[${unitList}]]*/ [], @@ -341,6 +344,7 @@ ENV.module.modalPopup.open(); + window.location.hash = 'modal-open'; document.querySelector('.modal-content').scrollTop = 0; diff --git a/front/src/main/resources/templates/status/daily.html b/front/src/main/resources/templates/status/daily.html index f9643d5f..1faa7945 100644 --- a/front/src/main/resources/templates/status/daily.html +++ b/front/src/main/resources/templates/status/daily.html @@ -152,6 +152,7 @@ const modal01 = document.querySelector(ENV.modal.selector).ui; modal01.open(); + window.location.hash = 'modal-open'; }, function(code, rstData) { kri.logger.error('Do nothing. code: '+ code, rstData);