File "currency-selectors.min.js"

Path: /StudyIB/js/subscribe/currency-selectorsminjs
File size: 1.15 KB
MIME-type: text/plain
Charset: utf-8

 
Open Back
var currency="";function initCurrencyChanger(){"undefined"!=typeof Storage&&localStorage.hasOwnProperty("userCurrency")&&updateCurrencySelector(currency=localStorage.getItem("userCurrency")),updateCurrency(currency),$(".currency-selector").find('input[type="radio"], select').on("change",(function(){updateCurrency(currency=$(this).val()),cleanSelector($(this).closest(".currency-selector")),$.post("/pages/subscribe/update-cart.php",{action:"update-currency",ticket:$("#ticket").val(),currency:currency})}))}function updateCurrency(e){$(".currency").each((function(){$(this).hasClass("currency-"+e)?$(this).removeClass("hidden"):$(this).addClass("hidden")})),"undefined"!=typeof Storage&&(localStorage.setItem("userCurrency",e),updateCurrencySelector(e))}function cleanSelector(e){"undefined"!=typeof isMobileDevice&&isMobileDevice()?(e.find(".alert").hide(),e.find("h5").show()):(e.removeClass("alert alert-warning"),e.find("h5").html("<strong>Choose currency</strong>"))}function updateCurrencySelector(e){$(".currency-selector").find('input[type="radio"][value="'+e+'"]').prop("checked",!0),$(".currency-selector").find("select").val(e),$('input[name="currency"]').val(e)}