Current File : /var/www/kurt6690.2978.w2868/site96340/wp-content/themes/hopeui/assets/js/customizer.min.js
"use strict";function hopeui_scriptGetAllSelects(t){var e=t.find(".google-fonts-size"),e=e.val().includes("px")?e.val():e.val()+e.attr("data-unit"),e={font:t.find(".google-fonts-list").val(),regularweight:t.find(".google-fonts-regularweight-style").val(),boldweight:t.find(".google-fonts-boldweight-style").val(),size:e,category:t.find(".google-fonts-category").val()};t.find(".customize-control-google-font-selection").val(JSON.stringify(e)).trigger("change")}!function(a){function n(){function t(o){if(null!=i[o].condition)for(var t in i[o].condition)!function(e){wp.customize(e).bind(function(t){wp.customize.control(i[o].settings.default).container.toggleOnCondition(i[o].condition[e]==t)}),n||wp.customize.control(i[o].settings.default).container.is(":visible")?n||wp.customize.control(i[o].settings.default).container.toggleOnCondition(i[o].condition[e]==wp.customize(e)._value):wp.customize.control(i[o].settings.default).container.toggleOnCondition(!1)}(t)}var e,n=0<arguments.length&&void 0!==arguments[0]&&arguments[0],i=wp.customize.settings.controls;for(e in i)t(e)}var i={breadcrumb:"breadcrumb_section_tabs",header_layout:"header_section_tabs"};a.fn.extend({toggleOnCondition:function(t){t?this.show():this.hide()}});a(document).ready(function(){a(".slider-custom-control").each(function(){var o=a(this).find(".customize-control-slider-value"),t=a(this).find(".slider"),e=parseFloat(t.attr("slider-min-value")),n=parseFloat(t.attr("slider-max-value")),i=parseFloat(t.attr("slider-step-value")),s=a(this).find(".slider-reset");t.slider({value:o.val(),min:e,max:n,step:i,slide:function(t,e){o.val(e.value).trigger("change")},change:function(t,e){o.val(e.value).trigger("change")}}),s.on("click",function(t){o.val(s.attr("slider-reset-value")).trigger("change")})}),a(".customize-control-dropdown-select2").each(function(){a(".customize-control-select2").select2({minimumResultsForSearch:-1})}),a(".customize-control-select2").on("change",function(){var t=a(this).val();a(this).parent().find(".customize-control-dropdown-select2").val(t).trigger("change")}),a(".customize-control-hopeui_php_section_tabs .hopeui_style-section-tabs .hopeui_style-section-tab-item").on("click",function(t){a(t.currentTarget).addClass("checked").siblings().removeClass("checked")});for(var o in i)!function(){var t=wp.customize.section(o).controls(),e=void 0;t.forEach(function(t){"hopeui_php_section_tabs"==t.params.type?(e=t.params.default,t.setting.set(e)):t.params.tab!=e&&t.container.toggleOnCondition(!1)}),wp.customize.control(i[o]).setting.bind(function(e){t.forEach(function(t){"customize-control-hopeui_php_section_tabs-content"!=t.templateSelector&&void 0!==t.params.tab&&(t.container.toggleOnCondition(t.params.tab==e),n(!0))})})}();n(),a(".toggle_button_button_control input[type=checkbox]").on("change",function(t){a(t.target).parent().toggleClass("active")}),a(".hopeui_style-twodimension_input .button-decrement").on("click",function(){var t=a(this).parent().find("input");t.val(Number(t.val())-1).change()}),a(".hopeui_style-twodimension_input .button-increment").on("click ",function(){var t=a(this).parent().find("input");t.val(Number(t.val())+1).change()}),a(".hopeui_style-twodimension_input .number-input-text-box,.hopeui_style-twodimension_input .customize-control-select2").on("change",function(){var t=a(this).parents(".hopeui_style-twodimension_input").find(".hopeui_style-twodimension-val"),e=a(this).parents(".hopeui_style-twodimension_input"),e={height:e.find(".hopeui_style-height").val(),width:e.find(".hopeui_style-width").val(),unit:e.find(".hopeui_style-unit").val()};t.val(JSON.stringify(e)).change()}),wp.customize.section("loader",function(t){t.expanded.bind(function(t){wp.customize.previewer.send("show_loader",t)})}),wp.customize.section("fourzerofour",function(t){t.expanded.bind(function(t){t&&wp.customize.previewer.previewUrl(wp.customize.settings.url.home+"index.php/404")})}),wp.customize.section("page_settings",function(t){t.expanded.bind(function(t){t&&wp.customize.previewer.previewUrl(wp.customize.settings.url.home+"index.php/?s=h")})}),a(".hopeui_style-typography-dropdown-button").on("click",function(){a(this).parents(".hopeui_style-typography").next().toggleClass("active").slideToggle()}),a(".google_fonts_select_control select").each(function(t,e){a(e).hasClass("google-fonts-list")?a(e).select2():a(e).select2({minimumResultsForSearch:-1})}),a(".google-fonts-list").on("change",function(){var t=a(this).parents(".google_fonts_select_control").find(".google-fonts-regularweight-style"),o=a(this).parents(".google_fonts_select_control").find(".google-fonts-italicweight-style"),n=a(this).parents(".google_fonts_select_control").find(".google-fonts-boldweight-style"),i=a(this).val(),e=a(this).attr("control-name"),s=0,l=0,e=(t.empty(),o.empty(),n.empty(),o.prop("disabled",!1),n.prop("disabled",!1),_wpCustomizeSettings.controls[e]),c=a.map(e.hopeui_scriptfontslist,function(t,e){if(t.family===i)return e})[0];e.hopeui_scriptfontslist[c].variants.includes("italic")&&t.append(a("<option></option>").val("italic").html("italic")),t.append(a("<option></option>").val("normal").html("normal")),a.each(e.hopeui_scriptfontslist[c].variants,function(t,e){0<=e.indexOf("italic")?(o.append(a("<option></option>").val(e).html(e)),s++):(n.append(a("<option></option>").val(e).html(e)),l++)}),0==s&&(o.append(a("<option></option>").val("").html("Not Available for this font")),o.prop("disabled","disabled")),0==l&&(n.append(a("<option></option>").val("").html("Not Available for this font")),n.prop("disabled","disabled")),a(this).parents(".google_fonts_select_control").find(".google-fonts-category").val(e.hopeui_scriptfontslist[c].category),hopeui_scriptGetAllSelects(a(this).parents(".google_fonts_select_control"))}),a(".google_fonts_select_control select,.google_fonts_select_control input").on("input",function(){hopeui_scriptGetAllSelects(a(this).parents(".google_fonts_select_control"))})})}(jQuery);