diff --git a/src/containers/flight/NewFlightApprovalsContainer.js b/src/containers/flight/NewFlightApprovalsContainer.js index a74e390d..2ef97b42 100644 --- a/src/containers/flight/NewFlightApprovalsContainer.js +++ b/src/containers/flight/NewFlightApprovalsContainer.js @@ -131,28 +131,19 @@ export default function NewFlightApprovalsContainer({ mode }) { } if (savedRightMenuRef.current) { - console.log('@?@?@?'); - // 부모 창의 특정 영역 (right-layer)의 위치와 크기 - const specificArea = { - left: window.screenX + window.outerWidth - clientX, // 영역을 넓게 설정 - right: window.screenX + window.outerWidth - clientX - }; - console.log(specificArea); - // 팝업 창의 현재 위치 - const popupRightEdge = popup.screenX + popup.outerWidth; - - // window.screenX + window.outerWidth - e.clientX - console.log(popupRightEdge); - // console.log('Popup Position:', { popupLeft, popupTop }); - if ( - popupRightEdge >= specificArea.left && - popupRightEdge <= specificArea.right - ) { + const popupX = popup.screenX; + + const parentX = window.screenX + savedRightMenuRef.current.left - 70; + + const parentWidth = savedRightMenuRef.current.width; + + if (popupX >= parentX && popupX <= parentX + parentWidth) { + popup.close(); setIsPopup(false); clearInterval(timer); } } - }, 1000); // 1초마다 체크 + }, 500); // 1초마다 체크 } window.addEventListener('message', childMessage); @@ -189,7 +180,7 @@ export default function NewFlightApprovalsContainer({ mode }) { // const popupY = Math.round( // window.screenY + window.outerHeight / 2 - popupHeight / 2 // ); - setClientX(window.screenX + window.outerWidth - e.clientX); + // setClientX(window.screenX + window.outerWidth - e.clientX); const popupX = window.screenX + (window.outerWidth - popupWidth) / 2 +