View file File name : astra-advanced-headers-admin.min.js Content :!function(o){AstraPageTitleBarAdmin={_init:function(){this._bind(),this._initLayoutSettings(),this._inputFileInit()},_bind:function(){o("li#menu-appearance.wp-has-current-submenu, li#menu-appearance.wp-has-current-submenu > a").removeClass("wp-has-current-submenu"),o("li#toplevel_page_"+astraPageHeaderVars.home_slug+", li#toplevel_page_"+astraPageHeaderVars.home_slug+" > a").removeClass("wp-not-current-submenu").addClass("wp-has-current-submenu"),o("li#toplevel_page_"+astraPageHeaderVars.home_slug+' a[href="edit.php?post_type=astra_adv_header"]').parent().addClass("current"),o(".ast-advanced-headers-heading-help").tooltip({content:function(){return o(this).prop("title")},tooltipClass:"ast-advanced-headers-ui-tooltip",position:{my:"center top",at:"center bottom+10"},hide:{duration:200},show:{duration:200}}),o(".ast-advanced-headers-heading-img-help").tooltip({content:function(){return o(this).prop("title")},tooltipClass:"ast-advanced-headers-ui-img-tooltip",position:{my:"center top",at:"center bottom+10"},hide:{duration:0},show:{duration:0}}),o(".ast-advanced-headers-color-picker").wpColorPicker(),o(".ast-advanced-header-layout-radio-button-wrap label").on("click",this._astraPageTitleRadioImagesClicked),o("#ast-advanced-headers-tabs ul li a").on("click",this._astraPageTitleTabsClicked),o("#ast-advanced-header-layout-breadcrumb").on("change",this._astraBreadcrumbChecked),o("#ast-advanced-header-layout-merged").on("change",this._astrPageTitleMergeChecked),o("#ast-advanced-header-design-bg-size").on("change",this._astrPageTitleBgSizeChecked),o("#ast-advanced-header-layout-above-header").on("change",this._astrAboveHeaderChecked),o("#ast-advanced-header-layout-below-header").on("change",this._astrBelowHeaderChecked),o("#ast-advanced-headers-design-custom-menu-item").on("change",this._astrCustomMenuChanged),o("#ast-advanced-headers-design-custom-menu-item").trigger("change"),o('input[name="ast-advanced-headers-layout[force-transparent-disabled]"]').on("change",function(){o('input[name="ast-advanced-headers-layout[force-transparent-disabled]"]').not(this).prop("checked",!1)}),o("#ast-advanced-header-diff-header-logo").on("change",this._astrToggleLogo),o("#ast-advanced-header-diff-header-retina-logo").on("change",this._astrToggleRetinaLogo)},_inputFileInit:function(){var a;window.inputWrapper="",o(document.body).on("click",".ast-advanced-headers-bg-image-select",function(e){e.preventDefault();o(this);window.inputWrapper=o(this).closest(".ast-advanced-headers-row-content"),a||(a=wp.media({multiple:!1})).on("select",function(){var e=a.state().get("selection").first().toJSON();window.inputWrapper.find("#ast-advanced-headers-preview-img").children(".saved-image").remove(),window.inputWrapper.find("#ast-advanced-headers-preview-img").append('<img src="'+e.url+'" width="150" class="saved-image" style="margin-bottom:12px;" />'),window.inputWrapper.find(".ast-advanced-headers-bg-image-id").val(e.id),window.inputWrapper.find(".ast-advanced-headers-bg-image").val(e.url),o(".ast-advanced-headers-bg-image-remove").show()}),a.open()}),o(".ast-advanced-headers-bg-image-remove").on("click",function(e){e.preventDefault();var e=o(this),a=o(this).closest(".ast-advanced-headers-row-content");a.find("#ast-advanced-headers-preview-img img").hide(),a.find(".ast-advanced-headers-bg-image-id").val(""),a.find(".ast-advanced-headers-bg-image").val(""),e.hide()}),o(document.body).on("click",".ast-advanced-header-logo-select",function(e){e.preventDefault();o(this);window.inputWrapper=o(this).closest(".ast-advanced-headers-row-content"),a||(a=wp.media({multiple:!1})).on("select",function(){var e=a.state().get("selection").first().toJSON();window.inputWrapper.find("#ast-advanced-headers-preview-logo").children(".saved-image").remove(),window.inputWrapper.find("#ast-advanced-headers-preview-logo").append('<img src="'+e.url+'" class="saved-image" style="margin-bottom:12px;max-width:150px;" />'),window.inputWrapper.find(".ast-advanced-headers-logo-id").val(e.id),window.inputWrapper.find(".ast-advanced-headers-logo").val(e.url),window.inputWrapper.find(".ast-advanced-headers-logo-remove").show()}),a.open()}),o(".ast-advanced-headers-logo-remove").on("click",function(e){e.preventDefault();var e=o(this),a=o(this).closest(".ast-advanced-headers-row-content");a.find("#ast-advanced-headers-preview-logo img").hide(),a.find(".ast-advanced-headers-logo-id").val(""),a.find(".ast-advanced-headers-logo").val(""),e.hide()}),window.inputWrapper=""},_astraBreadcrumbChecked:function(e){o(this).is(":checked")?o(".ast-advanced-headers-row.breadcrumb-row").show():o(".ast-advanced-headers-row.breadcrumb-row").hide()},_astrPageTitleBgSizeChecked:function(e){"custom-bg-size"==o(this).val()?o(".ast-advanced-haeders-design-bg-custom-size-wrap").show():o(".ast-advanced-haeders-design-bg-custom-size-wrap").hide()},_astrAboveHeaderChecked:function(e){o(this).is(":checked")?o(".ast-advanced-headers-row.ast-above-header-required").show():o(".ast-advanced-headers-row.ast-above-header-required").hide()},_astrBelowHeaderChecked:function(e){o(this).is(":checked")?o(".ast-advanced-headers-row.ast-below-header-required").show():o(".ast-advanced-headers-row.ast-below-header-required").hide()},_astrCustomMenuChanged:function(e){var a=o(this).val();"default"!=a&&"none"!=a?o(".ast-advanced-headers-row.ast-custom-menu-item-enabled").show():o(".ast-advanced-headers-row.ast-custom-menu-item-enabled").hide(),"text-html"==a?o(".ast-advanced-headers-row.ast-custom-menu-item-text-enabled").show():o(".ast-advanced-headers-row.ast-custom-menu-item-text-enabled").hide(),"search"==a?o("#ast-advanced-headers-design-search-style").parents(".ast-advanced-headers-row").show():o("#ast-advanced-headers-design-search-style").parents(".ast-advanced-headers-row").hide()},_astrPageTitleMergeChecked:function(e){o(this).is(":checked")?o(".require-merge-ast-advanced-header").show():o(".require-merge-ast-advanced-header").hide()},_astraPageTitleTabsClicked:function(e){e.preventDefault();var e=o(this),a=e.attr("href");o("#ast-advanced-headers-tabs ul li a").removeClass("nav-tab-active"),o(e).addClass("nav-tab-active"),o(".ast-adv-headers-tabs-section").removeClass("tab-active"),o(a).addClass("tab-active"),tabId=e.attr("id"),o("#advanced-headers-current-tab").val(tabId)},_initLayoutSettings:function(){var e=o('input[name="ast-advanced-headers-layout[layout]"]:checked').val(),a=o(".ast-advanced-header-layout-breadcrumb-wrap, .ast-advanced-headers-table.design-wrap"),t=o(".ast-required-no-headers"),d=o("#ast-advanced-header-layout-breadcrumb"),s=o("#ast-advanced-header-layout-merged"),r=o("#ast-advanced-header-design-bg-size").val(),i=o("#ast-advanced-header-diff-header-logo"),n=o("#ast-advanced-header-diff-header-retina-logo");"disable"==e?(a.hide(),t.show(),o(".ast-transparent-notice-wrap").show()):(t.hide(),o(".ast-transparent-notice-wrap").hide()),d.is(":checked")||o(".ast-advanced-headers-row.breadcrumb-row").hide(),s.is(":checked")||o(".require-merge-ast-advanced-header").hide(),"custom-bg-size"!=r&&o(".ast-advanced-haeders-design-bg-custom-size-wrap").hide(),o("#ast-advanced-header-layout-above-header").is(":checked")||o(".ast-advanced-headers-row.ast-above-header-required").hide(),o("#ast-advanced-header-layout-below-header").is(":checked")||o(".ast-advanced-headers-row.ast-below-header-required").hide(),i.is(":checked")?(o(".ast-logo-settings-wrap").show(),o(".ast-diff-header-retina-logo").show()):(o(".ast-logo-settings-wrap").hide(),o(".ast-diff-header-retina-logo").hide()),n.is(":checked")&&i.is(":checked")?o(".ast-retina-logo-settings-wrap").show():o(".ast-retina-logo-settings-wrap").hide()},_astraPageTitleRadioImagesClicked:function(){var e=o(".ast-advanced-header-layout-radio-button-wrap label"),a=o(".ast-advanced-header-layout-radio-button-wrap"),t=o(".ast-advanced-header-layout-breadcrumb-wrap, .ast-advanced-headers-table.design-wrap"),d=o(".ast-required-no-headers");e.attr("checked",!1),o(this).attr("checked",!0),a.children("input[type='radio']").attr("checked",!1),o(this).children("input[type='radio']").attr("checked",!0),"disable"==o(this).children("input[type='radio']").val()?(t.hide(),d.show(),o(".ast-transparent-notice-wrap").show()):(t.show(),d.hide(),o(".ast-transparent-notice-wrap").hide())},_astrToggleLogo:function(){o(this).is(":checked")?(o(".ast-logo-settings-wrap").show(),o(".ast-diff-header-retina-logo").show()):(o(".ast-logo-settings-wrap").hide(),o(".ast-diff-header-retina-logo").hide()),o(this).is(":checked")&&o("#ast-advanced-header-diff-header-retina-logo").is(":checked")?o(".ast-retina-logo-settings-wrap").show():o(".ast-retina-logo-settings-wrap").hide()},_astrToggleRetinaLogo:function(){o(this).is(":checked")&&o("#ast-advanced-header-diff-header-logo").is(":checked")?o(".ast-retina-logo-settings-wrap").show():o(".ast-retina-logo-settings-wrap").hide()}},o(function(){AstraPageTitleBarAdmin._init()})}(jQuery);