2020-04-07 13:03:04 +00:00
|
|
|
jQuery( document ).ready( function($) {
|
|
|
|
$( '.generatepress-control-toggles' ).each( function() {
|
|
|
|
$( this ).find( 'button' ).first().addClass( 'active' );
|
|
|
|
} );
|
|
|
|
|
|
|
|
$( document ).on( 'click', '.generatepress-control-toggles button', function( e ) {
|
|
|
|
e.preventDefault();
|
|
|
|
var button = $( this ),
|
|
|
|
target = button.data( 'target' ),
|
|
|
|
other_targets = button.siblings();
|
|
|
|
|
|
|
|
button.addClass( 'active' );
|
|
|
|
button.siblings().removeClass( 'active' );
|
|
|
|
|
|
|
|
$( 'li[data-control-section="' + target + '"]' ).css( {
|
|
|
|
visibility: 'visible',
|
|
|
|
height: '',
|
|
|
|
width: '',
|
2020-05-04 15:57:08 +00:00
|
|
|
margin: '',
|
|
|
|
overflow: '',
|
2020-04-07 13:03:04 +00:00
|
|
|
} );
|
|
|
|
|
|
|
|
$.each( other_targets, function( index, value ) {
|
|
|
|
var other_target = $( this ).data( 'target' );
|
|
|
|
$( 'li[data-control-section="' + other_target + '"]' ).css( {
|
|
|
|
visibility: 'hidden',
|
|
|
|
height: '0',
|
|
|
|
width: '0',
|
2020-05-04 15:57:08 +00:00
|
|
|
margin: '0',
|
|
|
|
overflow: 'hidden',
|
2020-04-07 13:03:04 +00:00
|
|
|
} );
|
|
|
|
} );
|
|
|
|
} );
|
|
|
|
});
|