Skip to content

Commit

Permalink
Some customizer changes
Browse files Browse the repository at this point in the history
  • Loading branch information
obenland committed Aug 27, 2012
1 parent b3d35bf commit 6308f3e
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions js/theme-customizer.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -11,29 +11,36 @@ jQuery( function( $ ) {
}); });
wp.customize( 'the_bootstrap_theme_options[theme_layout]', function( value ) { wp.customize( 'the_bootstrap_theme_options[theme_layout]', function( value ) {
value.bind( function( to ) { value.bind( function( to ) {
jQuery( 'body' ).removeClass( 'content-sidebar sidebar-content' ).addClass( to ); $( 'body' ).removeClass( 'content-sidebar sidebar-content' ).addClass( to );
}); });
}); });
wp.customize( 'the_bootstrap_theme_options[navbar_site_name]', function( value ) { wp.customize( 'the_bootstrap_theme_options[navbar_site_name]', function( value ) {
value.bind( function( to ) { value.bind( function( to ) {
jQuery( 'span.brand' ).remove(); $( 'span.brand' ).remove();
if ( to ) if ( to )
jQuery( '<span>' ).addClass( 'brand' ).text( the_bootstrap_customize.sitename ).insertBefore( '.nav-collapse' ); $( '<span>' ).addClass( 'brand' ).text( the_bootstrap_customize.sitename ).insertBefore( '.nav-collapse' );
}); });
}); });
wp.customize( 'the_bootstrap_theme_options[navbar_searchform]', function( value ) { wp.customize( 'the_bootstrap_theme_options[navbar_searchform]', function( value ) {
value.bind( function( to ) { value.bind( function( to ) {
jQuery( '.navbar-search').remove(); $( '.navbar-search').remove();
if ( to ) if ( to )
jQuery( '.nav-collapse' ).append( the_bootstrap_customize.searchform ); $( '.nav-collapse' ).append( the_bootstrap_customize.searchform );
});
});
wp.customize( 'the_bootstrap_theme_options[navbar_inverse]', function( value ) {
value.bind( function( to ) {
$( '.navbar').removeClass( 'navbar-inverse' );
if ( to )
$( '.navbar').addClass( 'navbar-inverse' );
}); });
}); });
wp.customize( 'the_bootstrap_theme_options[navbar_position]', function( value ) { wp.customize( 'the_bootstrap_theme_options[navbar_position]', function( value ) {
value.bind( function( to ) { value.bind( function( to ) {
$( '.navbar' ).removeClass( 'navbar-fixed-top navbar-fixed-bottom' ); $( '.navbar' ).removeClass( 'navbar-fixed-top navbar-fixed-bottom' );
$( 'body > .container' ).attr( 'style', 'margin: 18px auto !important;' ); $( 'body > .container' ).css( 'margin', '18px auto !important;' );
if ( 'static' != to ) { if ( 'static' != to ) {
jQuery( '.navbar' ).addClass(to); jQuery( '.navbar' ).addClass( to );
var margin = ( 'navbar-fixed-top' == to ) ? 'margin-top' : 'margin-bottom'; var margin = ( 'navbar-fixed-top' == to ) ? 'margin-top' : 'margin-bottom';
$( 'body > .container' ).css( margin, '58px' ); $( 'body > .container' ).css( margin, '58px' );
} }
Expand Down

0 comments on commit 6308f3e

Please sign in to comment.