Skip to content

Commit

Permalink
check for fixed header styles on partial refreshes, fixes #91
Browse files Browse the repository at this point in the history
  • Loading branch information
timelsass committed May 14, 2019
1 parent 1e6a1d2 commit b3a92cd
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/assets/js/customizer/customizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,14 @@ api.selectiveRefresh.bind( 'partial-content-rendered', placement => {

css = _.isEmpty( css ) ? '' : `${ css.join( ', ' ) } { display: none !important; }`;

// Ensure partial refresh styles are updated for fixed header.
if (
'bgtfw_header_layout' === placement.partial.id &&
( _.isUndefined( api( 'bgtfw_fixed_header' ) ) || false === api( 'bgtfw_fixed_header' )() )
) {
css += '#boldgrid-sticky-wrap .bgtfw-sticky-header { display: none !important; }';
}

document.getElementById( 'sticky-header-display-inline-css' ).innerHTML = css;
}
} );
Expand Down Expand Up @@ -733,7 +741,7 @@ BOLDGRID.Customizer.Util.getInitialPalettes = function( option ) {
}

// Listen for widget layout changes.
[ 'bgtfw_header_layout', 'bgtfw_sticky_header_layout' ,'bgtfw_footer_layout' ].forEach( control => {
[ 'bgtfw_header_layout', 'bgtfw_sticky_header_layout', 'bgtfw_footer_layout' ].forEach( control => {
api( control, value => {
value.bind( () => {
api.preview.send( 'bgtfw-widget-section-update', control );
Expand Down

0 comments on commit b3a92cd

Please sign in to comment.