WordPress/wp-content/themes/twentyseventeen/assets/js/panel-customizer.js
David A. Kennedy 7fbb094586 Importing Twenty Seventeen, our new default theme for 2017, set for 4.7.
With a focus on business sites, it will let you get down to business in style. Initial development occurred on GitHub. See: https://github.com/WordPress/twentyseventeen

Props melchoyce, laurelfulford, davidakennedy, grapplerulrich, manishsongirkar36, joefusco, smyoon315, b-07, rabmalin, mrahmadawais, hardeepasrani, implenton, acmethemes, claudiosanches, valeriutihai, pressionate, sgr33n, doughamlin, zodiac1978, tsl143, nikschavan, joshcummingsdesign, enodekciw, jordesign, patilvikasj, ryelle, mahesh901122, williampatton, juanfra, imnok, littlebigthing, mor10, samikeijonen, celloexpressions, akshayvinchurkar, davidmosterd, hiddenpearls, netweb, pratikchaskar, taggon, nukaga, ranh, yoavf, karmatosed, sandesh055, adammacias, noplanman, yogasukma, binarymoon, swapnilld, swissspidy, joyously, allancole, rianrietveld, sixhours, alex27, themeshaper, mapk, leobaiano.

See #38372.

Built from https://develop.svn.wordpress.org/trunk@38833


git-svn-id: http://core.svn.wordpress.org/trunk@38776 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-20 04:12:31 +00:00

42 lines
1.9 KiB
JavaScript

/**
* Theme Customizer enhancements, specific to panels, for a better user experience.
*
* This allows us to detect when the user has opened specific sections within the Customizer,
* and adjust our preview pane accordingly.
*/
( function() {
wp.customize.bind( 'ready', function() {
// Detect when the section for each panel is expanded (or closed) so we can adjust preview accordingly
wp.customize.section( 'panel_1' ).expanded.bind( function( isExpanding ) {
// Value of isExpanding will = true if you're entering the section, false if you're leaving it
wp.customize.previewer.send( 'section-highlight', { section: 'twentyseventeen-panel1', expanded: isExpanding } );
} );
// Detect when the section for each panel is expanded (or closed) so we can adjust preview accordingly
wp.customize.section( 'panel_2' ).expanded.bind( function( isExpanding ) {
// Value of isExpanding = true if you're entering the section, false if you're leaving it
wp.customize.previewer.send( 'section-highlight', { section: 'twentyseventeen-panel2', expanded: isExpanding } );
} );
// Detect when the section for each panel is expanded (or closed) so we can adjust preview accordingly
wp.customize.section( 'panel_3' ).expanded.bind( function( isExpanding ) {
// Value of isExpanding will = true if you're entering the section, false if you're leaving it
wp.customize.previewer.send( 'section-highlight', { section: 'twentyseventeen-panel3', expanded: isExpanding } );
} );
// Detect when the section for each panel is expanded (or closed) so we can adjust preview accordingly
wp.customize.section( 'panel_4' ).expanded.bind( function( isExpanding ) {
// Value of isExpanding will = true if you're entering the section, false if you're leaving it
wp.customize.previewer.send( 'section-highlight', { section: 'twentyseventeen-panel4', expanded: isExpanding } );
} );
} );
} )( jQuery );