( function( $ ) { 'use strict'; var $window = $( window ), $document = $( document ), $body = $( 'body' ); // Site title and description. wp.customize( 'blogname', function( value ) { value.bind( function( to ) { $( '.site-title' ).text( to ); } ); } ); wp.customize( 'blogdescription', function( value ) { value.bind( function( to ) { $( '.site-description' ).text( to ); } ); } ); wp.customize.bind( 'preview-ready', function() { var defaultTarget = window.parent === window ? null : window.parent; $document.on( 'click', '.site-header-focus-item .item-customizer-focus, .builder-item-focus .edit-row-action', function(e) { e.preventDefault(); e.stopPropagation(); var p = $( this ).closest( '.site-header-focus-item' ); var section_id = p.attr( 'data-section' ) || ''; if ( section_id ) { if ( defaultTarget.wp.customize.section( section_id ) ) { defaultTarget.wp.customize.section( section_id ).focus(); } } } ); $document.on( 'click', '.site-footer-focus-item .item-customizer-focus', function(e) { e.preventDefault(); e.stopPropagation(); var p = $( this ).closest( '.site-footer-focus-item' ); var section_id = p.attr( 'data-section' ) || ''; if ( section_id ) { if ( defaultTarget.wp.customize.section( section_id ) ) { defaultTarget.wp.customize.section( section_id ).focus(); } } } ); } ); document.addEventListener('DOMContentLoaded', function () { if ( navigator.userAgent.toLowerCase().indexOf('safari/') != -1 ) { if ( navigator.userAgent.toLowerCase().indexOf('chrome') > -1) { } else { // Safari doesn't want to render the iframe... This hack at least makes it render although it's not idea because of the flash. // $body.animate({ // opacity: 0, // }, 50, function() { // $body.css( 'display', 'none' ); // $body.css( 'opacity', 1 ); // }); // setTimeout(function(){ // $body.css( 'display', 'block' ); // }, 100); } } var hasSelectiveRefresh = ( 'undefined' !== typeof wp && wp.customize && wp.customize.selectiveRefresh && wp.customize.widgetsPreview && wp.customize.widgetsPreview.WidgetPartial ); if ( hasSelectiveRefresh ) { wp.customize.selectiveRefresh.bind('partial-content-rendered', function (placement) { if ( placement.partial.id === 'header_desktop_items' ) { window.kadence.initToggleDrawer(); } window.kadence.initTransHeaderPadding(); if ( typeof window.kadence.initStickyHeader !== "undefined" ) { window.kadence.initStickyHeader(); window.kadence.initScrollToTop(); } } ); } }); var kadenceCustomizer = { live_css_typography : function( key, rules, newValue ) { var styleID = 'kadence-customize-preview-css-' + key, $style = $( '#' + styleID ), css = '', media_tablet = '@media screen and (max-width: 1023px)', media_mobile = '@media screen and (max-width: 499px)', selector, cssArray = {}; // Create