/* /js/deptInputControl.js */ // geoActionGateWay() 펑션의 콜백함수 지정 var callBackFunc = "geoActionCallback"; $(document).ready( function() { /* #locationRefresherBtn 클릭에 반응... */ $(document).on("click","#locationRefreshBtn, #locationRefresherIcon", function() { if(mobileCheck==false) alert("데스크탑 PC 에서는 단말기 위치가 정확하지 않을 수 있습니다."); // 팝업 Off $("#deptPointDialogDiv").slideUp(); ajaxLoadingScreenOn(); geoActionGateWay(callBackFunc); }); // 출발지 인풋 클릭 대응 $(document).on( "click", "#deptAddrInputField", function() { console.log("출발지 인풋 클릭...."); //ajaxLoadingScreenOn2(); ready2ChangeDeptPoint(); }); // "주소로 선택" 버튼 클릭 대응 $(document).on( "click","#deptSelectByAddrBtn", function() { $("#deptPointDialogDiv").css("display", "none"); // AddressSelector 를 deptPointDialogOuterDiv 안에 삽입해준다. /* if( $("#deptPointDialogOuterDiv > #AddressSelector").length < 1 ) { $("#AddressSelector").appendTo("#deptPointDialogOuterDiv"); } */ $("#AddressSelector").slideDown().center(); // 셀렉트박스 모두 초기화... $("#provinceAtomSelectBox, #cityKuEupAtomSelectBox, #dongRiAtomSelectBox").prop("selectedIndex",0); //$('.wrap-loading').removeClass('display-none'); }); // 출발지 "주소로 선택" 다이알로그 선택완료 버튼 클릭 대응 $(document).on( "click", "#deptPointDialogSelectByAddrDoneBtn", function() { if( $("#dongRiAtomSelectBox").val() =="") { alert("출발위치의 주소를 모두 선택해주세요."); return; } var deptPointSelectedStr = $("#provinceAtomSelectBox").val() + " " + $("#cityKuEupAtomSelectBox option:selected").text() +" " + $("#dongRiAtomSelectBox option:selected").text(); console.log("deptPointSelectedStr: "+deptPointSelectedStr); $("#deptAddrInputField").val(deptPointSelectedStr); $("#deptFullAddr").val(deptPointSelectedStr); $("#deptGeoId").val($("#dongRiAtomSelectBox option:selected").val()); $("#AddressSelector").slideUp(); //$("#deptPointDialogDiv").slideDown().horCenter(); $('.wrap-loading').addClass('display-none'); }); // 출발지 셀렉터 다이알로그 클로즈 버튼 클릭 대응 $(document).on( "click", "#deptPointDialogDivCloseBtn", function(e) { e.preventDefault(); $("#deptPointDialogDiv").slideUp(); $('.wrap-loading').addClass('display-none'); }); // 출발지 "주소로 선택" 다이알로그 클로즈 버튼 클릭 대응 $(document).on( "click", "#deptPointDialogSelectByAddrCloseBtn", function(e) { e.preventDefault(); $("#AddressSelector").slideUp(); $("#deptPointDialogDiv").slideDown().horCenter(); //$('.wrap-loading').removeClass('display-none'); }); // "단말기 위치 읽어오기 버튼" 클릭시 대응 $(document).on("click","#readUserGeoLocationBtn", function() { ajaxLoadingScreenOn(); //callBackFunc = "swapDeptDisplay"; geoActionGateWay(); swapDeptDisplay(); //speechBubbleFadeIn( "#deptPointSpechBubbleDiv" ); }); // 사용자 입력 출발지 포인트네임 포커스에 대응 버블 안내를 띄운다. $(document).on("focus","#userInputDeptPointName", function() { speechBubbleFadeIn( "#deptPointSpechBubbleDiv" ); }); }); /* div1 과 div2 의 디스플레이를 맞바꾼다. */ function swapDeptDisplay( ) { console.log("펑션"); $(".orderDeptUnselected").slideUp(); $(".orderDeptSelected").slideDown(); ajaxLoadingScreenOff(); } // 출발지 인풋 클릭시 반응하는 프로세스들을 함수로 묶는다. function ready2ChangeDeptPoint() { /* $('html, body').animate({ // 스크롤 다운 scrollTop: $(".inquireChargeFormHeadline").offset().top-40 }, 500); // deptPointDialogDiv 를 deptPointDialogOuterDiv 안에 삽입해준다. if( $("#deptPointDialogOuterDiv > #deptPointDialogDiv").length < 1 ) { $("#deptPointDialogDiv").appendTo("#deptPointDialogOuterDiv"); } */ console.log("여기 펑션에서 암전을..."); $("#deptPointDialogDiv").slideDown(); $("#deptPointDialogDiv").center2(); //$("#deptPointDialogDiv").css("margin-top", "-200px"); $('#wrap-loading2').removeClass('display-none'); } jQuery.fn.center2 = function () { console.log("center2 function...."); this.css("position","absolute"); this.css("top", Math.max(0, (($(window).height() - $(this).outerHeight()) / 2) + $(window).scrollTop()) + "px"); this.css("left", Math.max(0, (($(window).width() - $(this).outerWidth()) / 2) + $(window).scrollLeft()) + "px"); return this; }