feat: 시추정보 사업별 현황에서 지도 이동 안 되는 버그 수정
parent
ea171f199f
commit
5f99ed3c3b
|
|
@ -171,15 +171,41 @@ function downloadNew(mId, fName) {
|
|||
</table></td>
|
||||
|
||||
<script>
|
||||
if (typeof opener.parent.parent.moveToExtent === "function") {
|
||||
//alert("1111");
|
||||
opener.parent.parent.moveToExtent("${bbox.minx}", "${bbox.miny}", "${bbox.maxx}", "${bbox.maxy}");
|
||||
opener.parent.parent.addProjectHoles("${project.projectCode}");
|
||||
} else if (typeof opener.opener.moveToExtent === "function") {
|
||||
//alert("2222");
|
||||
opener.opener.moveToExtent("${bbox.minx}", "${bbox.miny}", "${bbox.maxx}", "${bbox.maxy}");
|
||||
opener.opener.addProjectHoles("${project.projectCode}");
|
||||
}
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
var openerCalled = false;
|
||||
var checkOpenerInterval; // To store the interval ID
|
||||
|
||||
function tryCallingOpenerFunctions() {
|
||||
if (typeof opener.parent.parent.moveToExtent === "function") {
|
||||
// alert("1111"); // Uncomment for debugging
|
||||
opener.parent.parent.moveToExtent("${bbox.minx}", "${bbox.miny}", "${bbox.maxx}", "${bbox.maxy}");
|
||||
opener.parent.parent.addProjectHoles("${project.projectCode}");
|
||||
openerCalled = true; // Set flag to true
|
||||
} else if (typeof opener.opener.moveToExtent === "function") {
|
||||
// alert("2222"); // Uncomment for debugging
|
||||
opener.opener.moveToExtent("${bbox.minx}", "${bbox.miny}", "${bbox.maxx}", "${bbox.maxy}");
|
||||
opener.opener.addProjectHoles("${project.projectCode}");
|
||||
openerCalled = true; // Set flag to true
|
||||
}
|
||||
|
||||
// If either condition was met, stop the timer
|
||||
if (openerCalled) {
|
||||
clearInterval(checkOpenerInterval); // Stop the interval
|
||||
// console.log("Opener functions called and timer stopped."); // Uncomment for debugging
|
||||
}
|
||||
}
|
||||
|
||||
// Start checking every 100 milliseconds (adjust as needed)
|
||||
checkOpenerInterval = setInterval(tryCallingOpenerFunctions, 100);
|
||||
|
||||
// Optional: Add a timeout to stop checking after a certain period to prevent infinite loops
|
||||
setTimeout(function() {
|
||||
if (!openerCalled) {
|
||||
clearInterval(checkOpenerInterval);
|
||||
// console.warn("Opener functions could not be called within the timeout period."); // Uncomment for debugging
|
||||
}
|
||||
}, 200); // Stop after 5 seconds (5000 milliseconds)
|
||||
});
|
||||
</script>
|
||||
</tr>
|
||||
</table> <!--END:내용 -->
|
||||
|
|
|
|||
Loading…
Reference in New Issue