PATH:
home
/
lab2454c
/
costbloc.com
/
public
/
dist
/
js
/
custom
/
site
"use strict";let radioSwitch=!1;$(".radio-test").on('click',function(){$(".radio-error-msg").hide(),radioSwitch=!0}),$(".save-add-func").on('click',function(){radioSwitch?$(".radio-error-msg").hide():$(".radio-error-msg").show()});function formValidation(){return!(0<$(".addressForm").find(".error").length)&&($("#btnSubmit").attr("disabled","true"),!0)}$(document).ready(function(){function a(a){a?($("#state").html(""),"null"==oldCity&&$("#city").html(d),$.ajax({url:SITE_URL+"/geo-locale/countries/"+a+"/states",type:"GET",dataType:"json",beforeSend:function(){$("#state").attr("disabled","true"),$("#state").html(c)},success:function(a){$("#state").html(e),$.each(a.data,function(a,b){$("#state").append(`'<option ${b.code==oldState?"Selected":""} data-state="${b.code}" value="${b.code}">${b.name}</option>'`)}),$("#state").removeAttr("disabled"),0>=a.length&&0>=a.data.length&&(f=f.replace(":x","State"),$("#state").html(`<option value="">${f}</option>`))}})):($("#state").html(e),$("#city").html(d))}function b(a,b){a&&b?($("#city").html(""),$.ajax({url:SITE_URL+"/geo-locale/countries/"+b+"/states/"+a+"/cities",type:"GET",dataType:"json",beforeSend:function(){$("#city").html(c),$("#city").attr("disabled","true")},success:function(a){$("#city").html(d),$.each(a.data,function(a,b){$("#city").append(`<option ${b.name==oldCity?"Selected":""} value="${b.name}">${b.name}</option>`)}),$("#city").removeAttr("disabled"),0>=a.length&&0>=a.data.length&&(f=f.replace(":x","City"),$("#city").html(`<option value="">${f}</option>`))}})):$("#city").html(d)}$(".addressSelect").select2(),$(document).on("select2:open",a=>{const b=a.target.id;$(".select2-search__field[aria-controls='select2-"+b+"-results']").each(function(a,b){b.focus()})});let c=`<option value="">${jsLang("Loading")}...</option>`,d=`<option value="">${jsLang("Select City")}</option>`,e=`<option value="">${jsLang("Select State")}</option>`,f=jsLang(":x is not available.");$(".address-form , .checkout-address-form").find("#addressForm").length&&$.ajax({url:SITE_URL+"/geo-locale/countries",type:"GET",dataType:"json",beforeSend:function(){$("#country").html(c),$("#country").attr("disabled","true")},success:function(a){$("#country").html("<option value=\"\">"+jsLang("Select Country")+"</option>"),$.each(a,function(a,b){$("#country").append(`'<option ${b.code==oldCountry?"Selected":""} data-country="${b.code}" value="${b.code}">${b.name}</option>'`)}),$("#country").removeAttr("disabled")}}),"null"!=oldState&&a(oldCountry),"null"!=oldCity&&b(oldState,oldCountry),$("#country").on("change",function(){let b=$(this).find(":selected").html();if(oldCity="null",0<b.length){let a=this.closest(".validSelect");a.querySelector(".addressSelect").setCustomValidity(""),a.querySelector(".error")&&a.querySelector(".error").remove()}a($("#country").find(":selected").attr("data-country"))}),$("#state").on("change",function(){let a=$(this).find(":selected").html();if(0<a.length){let a=this.closest(".validSelect");a.querySelector(".addressSelect").setCustomValidity(""),a.querySelector(".error")&&a.querySelector(".error").remove()}b($("#state").find(":selected").attr("data-state"),$("#country").find(":selected").attr("data-country"))}),$("#city").on("change",function(){let a=$(this).find(":selected").html();if(0<a.length){let a=this.closest(".validSelect");a.querySelector(".addressSelect").setCustomValidity(""),a.querySelector(".error")&&a.querySelector(".error").remove()}})});
[-] checkout.js
[edit]
[-] be-seller.min.js
[edit]
[-] res-filter.min.js
[edit]
[-] sign_up.js
[edit]
[-] wishlist.min.js
[edit]
[-] filter.min.js
[edit]
[-] home.js
[edit]
[-] notification-popup.js
[edit]
[-] order-track.js
[edit]
[-] notification-popup.min.js
[edit]
[-] wishlist.js
[edit]
[-] description-tabs.js
[edit]
[-] vendor-profile.js
[edit]
[-] seller-registration.min.js
[edit]
[-] formatting.min.js
[edit]
[-] product-details.js
[edit]
[+]
..
[-] cart.min.js
[edit]
[-] be-seller.js
[edit]
[-] animation.min.js
[edit]
[-] product-view.min.js
[edit]
[-] address.js
[edit]
[-] lang.js
[edit]
[-] alpine.js
[edit]
[-] product-details.min.js
[edit]
[-] common.min.js
[edit]
[-] res-filter.js
[edit]
[-] order-track.min.js
[edit]
[-] common.js
[edit]
[-] drawer.js
[edit]
[-] seller.min.js
[edit]
[-] settings.js
[edit]
[-] checkout.min.js
[edit]
[-] coupon.js
[edit]
[-] login.js
[edit]
[-] seller.js
[edit]
[-] user_download.js
[edit]
[-] site.min.js
[edit]
[-] lang.min.js
[edit]
[-] seller-registration.js
[edit]
[-] password-validation.js
[edit]
[-] drawer.min.js
[edit]
[-] login.min.js
[edit]
[-] delivery-address.min.js
[edit]
[-] home.min.js
[edit]
[-] compare.js
[edit]
[-] description-tabs.min.js
[edit]
[-] all-categories.min.js
[edit]
[-] flatpickr.min.js
[edit]
[-] filter.js
[edit]
[-] cart.js
[edit]
[-] site.js
[edit]
[-] compare.min.js
[edit]
[-] animation.js
[edit]
[-] user_download.min.js
[edit]
[-] settings.min.js
[edit]
[-] vendor-profile.min.js
[edit]
[-] product-view.js
[edit]
[-] password-validation.min.js
[edit]
[-] address.min.js
[edit]
[-] formatting.js
[edit]
[-] coupon.min.js
[edit]
[-] delivery-address.js
[edit]
[-] sign_up.min.js
[edit]
[-] all-categories.js
[edit]