| Current Path : /var/www/homesaver/www/local/components/aspro/theme.next/templates/.default/ |
| Current File : /var/www/homesaver/www/local/components/aspro/theme.next/templates/.default/script.min.js |
var timerHide=!1;funcDefined("showToggles")||(showToggles=function(){new DG.OnOffSwitchAuto({cls:".block-item.active .custom-switch",textOn:"",height:33,heightTrack:16,textOff:"",trackColorOff:"f5f5f5",listener:function(t,e){var s=$("input[name="+t+"]").closest(".values").length;if(e?$("input[name="+t+"]").val("Y"):$("input[name="+t+"]").val("N"),s){var i,o=$('<div class="btn-ajax-block animation-opacity"></div>'),a=$("input[name="+t+"]").closest(".option-wrapper"),n=BX.pos(a[0],!0);o.html($(".values > .apply-block").html()),a.toggleClass("disabled"),i=n.top+$(".style-switcher .header").actual("outerHeight"),o.css("top",i),$(".btn-ajax-block").length&&$(".btn-ajax-block").remove(),o.appendTo($(".style-switcher")),o.addClass("opacity1")}setTimeout(function(){s||$("form[name=style-switcher]").submit()},200)}})}),$(document).ready(function(){$(".style-switcher .item input[type=checkbox]").on("change",function(){var t=$(this);t.is(":checked")?t.val("Y"):t.val("N"),$("form[name=style-switcher]").submit()}),$(".style-switcher .can_save .save_btn").on("click",function(){var t=$(this);timerHide&&(clearTimeout(timerHide),timerHide=!1),$.ajax({type:"POST",url:arNextOptions.SITE_DIR+"ajax/options_save.php",data:{SAVE_OPTIONS:"Y"},dataType:"json",success:function(e){"STATUS"in e&&($(".save_config_status").length||$('<div class="save_config_status"><span></span></div>').appendTo(t.parent()),"OK"===e.STATUS?$(".save_config_status").addClass("success"):$(".save_config_status").addClass("error"),$(".save_config_status span").text(BX.message(e.MESSAGE)),$(".save_config_status").slideDown(200),timerHide=setTimeout(function(){$(".save_config_status").slideUp(200,function(){$(this).remove()})},1e3))}})}),showToggles(),"open"==$.cookie("styleSwitcher")&&$(".style-switcher").addClass("active"),$(".base_color_custom input[type=hidden]").length&&$(".base_color_custom input[type=hidden]").each(function(){var t=$(this),e=$(this).closest(".base_color_custom");t.spectrum({preferredFormat:"hex",showButtons:!0,showInput:!0,showPalette:!1,appendTo:e,chooseText:BX.message("CUSTOM_COLOR_CHOOSE"),cancelText:BX.message("CUSTOM_COLOR_CANCEL"),containerClassName:"custom_picker_container",replacerClassName:"custom_picker_replacer",clickoutFiresChange:!1,move:function(t){var s=t.toHexString();e.find("span span").attr("style","background:"+s)},hide:function(t){var s=t.toHexString();e.find("span span").attr("style","background:"+s)},change:function(t){e.addClass("current").siblings().removeClass("current"),$("form[name=style-switcher] input[name="+e.find(".click_block").data("option-id")+"]").val(e.find(".click_block").data("option-value")),$("form[name=style-switcher]").submit()}})}),$(".base_color_custom").click(function(t){return t.preventDefault(),$("input[name="+$(this).data("name")+"]").spectrum("toggle"),!1}),$(".base_color.current").length&&$(".base_color.current").each(function(){var t=$(this).closest(".options").find(".base_color_custom"),e=$(this).data("color");void 0!=e&&e.length&&($("input[name="+t.data("name")+"]").spectrum("set",e),t.find("a span").attr("style","background:"+e))}),$(".style-switcher .switch").click(function(t){t.preventDefault();var e=$(this).closest(".style-switcher");HideHintBlock(),e.hasClass("active")?(e.addClass("closes"),setTimeout(function(){e.removeClass("active")},500),$.removeCookie("styleSwitcher",{path:"/"})):(ShowOverlay(),e.removeClass("closes").addClass("active"),$.cookie("styleSwitcher","open",{path:"/"}))}),HideHintBlock=function(){HideOverlay(),$.cookie("clickedSwitcher","Y",{path:"/"}),$(".hint-theme").length&&$(".hint-theme").fadeIn(300,function(){$(".hint-theme").remove()})},$(document).on("click",".close-overlay",function(){HideHintBlock()}),$(document).on("click",".jqmOverlay",function(){var t=$(".style-switcher");$(".hint-theme").length||HideOverlay(),t.each(function(){var t=$(this);t.addClass("closes"),setTimeout(function(){t.removeClass("active")},500),$(".form_demo-switcher").animate({left:"-"+$(".form_demo-switcher").outerWidth()+"px"},100).removeClass("active abs")}),$.removeCookie("styleSwitcher",{path:"/"})}),$(".style-switcher .section-block").on("click",function(){$(this).siblings().removeClass("active"),$(this).addClass("active"),$(".style-switcher .right-block .block-item").removeClass("active"),$(".style-switcher .right-block .block-item:eq("+$(this).index()+")").addClass("active"),$.cookie("styleSwitcherTabIndex",$(this).index(),{path:"/"}),$(this).hasClass("toggle_initied")||showToggles(),$(this).addClass("toggle_initied")}),$(".style-switcher .reset").click(function(t){$("form[name=style-switcher]").append('<input type="hidden" name="THEME" value="default" />'),$("form[name=style-switcher]").submit()}),$(document).on("click",".style-switcher .apply",function(){$("form[name=style-switcher]").submit()}),$(".style-switcher .sup-params.options .block-title").click(function(){$(this).next().slideToggle()}),$(".style-switcher .options > .link-item,.style-switcher .options > div:not(.base_color_custom) span.link-item,.style-switcher .options > div:not(.base_color_custom) .click_block").click(function(t){var e=$(this);if(!e.hasClass("current"))if(e.addClass("current").siblings().removeClass("current"),$("form[name=style-switcher] input[name="+e.data("option-id")+"]").val(e.data("option-value")),void 0!==$(this).data("option-type")&&$.cookie("scroll_block",$(this).data("option-type")),void 0!==$(this).data("option-url")&&$("form[name=style-switcher]").prepend('<input type="hidden" name="backurl" value='+$(this).data("option-url")+" />"),e.closest(".options").hasClass("refresh-block")){if(!e.closest(".options").hasClass("sup-params"))e.index();e.closest(".item").find(".sup-params.options").removeClass("active"),e.closest(".item").find(".sup-params.options.s_"+e.data("option-value")).addClass("active"),$("form[name=style-switcher]").submit()}else $("form[name=style-switcher]").submit()}),$(".tooltip-link").on("shown.bs.tooltip",function(t){var e=$(this).next(),s=($(window).height(),$(this).closest("form").scrollTop(),BX.pos($(this)[0],!0)),i=BX.pos(e[0],!0),o=BX.pos($(this).closest(".item")[0],!0);!$(this).closest(".item").next().length&&i.bottom>o.bottom&&(e.removeClass("bottom").addClass("top"),e.css({top:s.top-e.actual("outerHeight")}))})});