Unbind on display
This commit is contained in:
parent
28b99e6970
commit
74f9e16ac3
|
@ -138,6 +138,21 @@ class WC_Shop_Customizer {
|
||||||
} );
|
} );
|
||||||
} );
|
} );
|
||||||
|
|
||||||
|
wp.customize.section( 'woocommerce_store_notice', function( section ) {
|
||||||
|
section.expanded.bind( function( isExpanded ) {
|
||||||
|
if ( isExpanded ) {
|
||||||
|
var notice = wp.customize( 'woocommerce_demo_store_notice' ),
|
||||||
|
checkbox = wp.customize( 'woocommerce_demo_store' );
|
||||||
|
|
||||||
|
if ( checkbox.get() && ! notice.callbacks.has( notice.preview ) ) {
|
||||||
|
notice.bind( notice.preview );
|
||||||
|
} else if ( ! checkbox.get() ) {
|
||||||
|
notice.unbind( notice.preview );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} );
|
||||||
|
} );
|
||||||
|
|
||||||
wp.customize.section( 'woocommerce_product_catalog', function( section ) {
|
wp.customize.section( 'woocommerce_product_catalog', function( section ) {
|
||||||
section.expanded.bind( function( isExpanded ) {
|
section.expanded.bind( function( isExpanded ) {
|
||||||
if ( isExpanded ) {
|
if ( isExpanded ) {
|
||||||
|
|
Loading…
Reference in New Issue