/** * File customizer.js. * * Theme Customizer enhancements for a better user experience. * * Contains handlers to make Theme Customizer preview reload changes asynchronously. */ (function($) { // Collect information from customize-controls.js about which panels are opening. wp.customize.bind('preview-ready', function() { wp.customize.preview.bind('section-highlight-footerwidgets', function(data) { // When the section is expanded, show and scroll to the content placeholders, exposing the edit links. if (true === data.expanded) { $('.top-footer-wrap').addClass('panel-placeholder-focus'); $('.panel-placeholder.footerwidgets').slideDown("slow"); Foundation.SmoothScroll.scrollToLoc('#footer', { threshold: 50, duration: 400, offset: 100 }, function() { console.log('scrolled'); }); // If we've left the panel, hide the placeholders and scroll back to the top. } else { $('.top-footer-wrap').removeClass('panel-placeholder-focus'); // Don't change scroll when leaving - it's likely to have unintended consequences. $('.panel-placeholder.footerwidgets').fadeOut("slow"); } }); }); // Site title and description. wp.customize('blogname', function(value) { value.bind(function(to) { $('.site-title a').text(to); }); }); wp.customize('blogdescription', function(value) { value.bind(function(to) { $('.site-description').text(to); }); }); wp.customize('azeen_footertext', function(value) { value.bind(function(to) { $('.footer-copy .top-bar-left p').text(to); }); }); }(jQuery));