// Scripts used by the admin elements var $adm = jQuery.noConflict(); $adm(document).ready(function() { // Display grid settings box when Grid page template is chosen $adm('#page_template').change( function() { $adm('#grid_settings_metabox').toggle( $adm(this).val() == 'page-grid.php' ); }).change(); // Reveal extended page header settings when the respective checkbox is active var revealExtheader = function() { if ( $adm('#bnt_activate_header').is(':checked') ) { $adm('#cmb2-metabox-post_header_metabox .cmb-row:not(:first-child)').show(); } else { $adm('#cmb2-metabox-post_header_metabox .cmb-row:not(:first-child)').hide(); } } revealExtheader(); $adm('#bnt_activate_header').change( function() { revealExtheader(); }); // Reveal Google Maps header settings when the respective checkbox is active var revealMapheader = function() { if ( $adm('#bnt_activate_headermap').is(':checked') ) { $adm('#cmb2-metabox-post_headermap_metabox .cmb-row:not(:first-child)').show(); } else { $adm('#cmb2-metabox-post_headermap_metabox .cmb-row:not(:first-child)').hide(); } } revealMapheader(); $adm('#bnt_activate_headermap').change( function() { revealMapheader(); }); // Migrate old theme options into Customizer $adm('.notice-migrate-bento-options .button-primary').click(function() { $adm.ajax({ url: bntAdminVars.ajaxurl, type: 'POST', data: { action: 'bnt_migrate_customizer_options', }, success: function(response) { $adm('.notice-migrate-bento-options').hide(300, function() { $adm('.notice-migrate-bento-options-success').show(300); }); }, error: function(response) { alert('Darn! Something went wrong. Please try again or contact support@satoristudio.net'); } }); }); });