first commit
This commit is contained in:
@@ -0,0 +1,202 @@
|
||||
( function( $ ) {
|
||||
"use strict";
|
||||
|
||||
$( document ).on( 'ready', function() {
|
||||
|
||||
// Show/hide both sidebars options
|
||||
var bothSidebarsField = $( '#butterbean-control-ocean_post_layout select' ),
|
||||
bothSidebarsFieldVal = bothSidebarsField.val(),
|
||||
bothSidebarsSetting = $( '#butterbean-control-ocean_both_sidebars_style, #butterbean-control-ocean_both_sidebars_content_width, #butterbean-control-ocean_both_sidebars_sidebars_width, #butterbean-control-ocean_second_sidebar' );
|
||||
|
||||
bothSidebarsSetting.hide();
|
||||
|
||||
if ( bothSidebarsFieldVal === 'both-sidebars' ) {
|
||||
bothSidebarsSetting.show();
|
||||
}
|
||||
|
||||
bothSidebarsField.change( function () {
|
||||
|
||||
bothSidebarsSetting.hide();
|
||||
|
||||
if ( $( this ).val() == 'both-sidebars' ) {
|
||||
bothSidebarsSetting.show();
|
||||
}
|
||||
|
||||
} );
|
||||
|
||||
// Show/hide header options
|
||||
var headerField = $( '#butterbean-control-ocean_display_header .buttonset-input' ),
|
||||
headerMainSettings = $( '#butterbean-control-ocean_header_style' );
|
||||
|
||||
if ( $( '#butterbean-control-ocean_display_header #butterbean_oceanwp_mb_settings_setting_ocean_display_header_off' ).is( ':checked' ) ) {
|
||||
headerMainSettings.hide();
|
||||
} else {
|
||||
headerMainSettings.show();
|
||||
}
|
||||
|
||||
headerField.change( function () {
|
||||
|
||||
if ( $( this ).val() === 'off' ) {
|
||||
headerMainSettings.hide();
|
||||
} else {
|
||||
headerMainSettings.show();
|
||||
}
|
||||
|
||||
} );
|
||||
|
||||
// Show/hide custom header template field
|
||||
var headerStyleField = $( '#butterbean-control-ocean_header_style select' ),
|
||||
headerStyleFieldVal = headerStyleField.val(),
|
||||
customHeaderSetting = $( '#butterbean-control-ocean_custom_header_template' );
|
||||
|
||||
customHeaderSetting.hide();
|
||||
|
||||
if ( headerStyleFieldVal === 'custom' ) {
|
||||
customHeaderSetting.show();
|
||||
}
|
||||
|
||||
if ( $( '#butterbean-control-ocean_display_header #butterbean_oceanwp_mb_settings_setting_ocean_display_header_off' ).is( ':checked' ) ) {
|
||||
customHeaderSetting.hide();
|
||||
}
|
||||
|
||||
headerField.change( function () {
|
||||
|
||||
if ( $( this ).val() === 'off' ) {
|
||||
customHeaderSetting.hide();
|
||||
} else {
|
||||
var headerStyleFieldVal = headerStyleField.val();
|
||||
|
||||
if ( headerStyleFieldVal === 'custom' ) {
|
||||
customHeaderSetting.show();
|
||||
}
|
||||
}
|
||||
|
||||
} );
|
||||
|
||||
headerStyleField.change( function () {
|
||||
|
||||
customHeaderSetting.hide();
|
||||
|
||||
if ( $( this ).val() == 'custom' ) {
|
||||
customHeaderSetting.show();
|
||||
}
|
||||
|
||||
} );
|
||||
|
||||
// Show/hide left menu for center header style
|
||||
var leftMenuSetting = $( '#butterbean-control-ocean_center_header_left_menu' );
|
||||
|
||||
leftMenuSetting.hide();
|
||||
|
||||
if ( headerStyleFieldVal === 'center' ) {
|
||||
leftMenuSetting.show();
|
||||
}
|
||||
|
||||
if ( $( '#butterbean-control-ocean_display_header #butterbean_oceanwp_mb_settings_setting_ocean_display_header_off' ).is( ':checked' ) ) {
|
||||
leftMenuSetting.hide();
|
||||
}
|
||||
|
||||
headerField.change( function () {
|
||||
|
||||
if ( $( this ).val() === 'off' ) {
|
||||
leftMenuSetting.hide();
|
||||
} else {
|
||||
var headerStyleFieldVal = headerStyleField.val();
|
||||
|
||||
if ( headerStyleFieldVal === 'center' ) {
|
||||
leftMenuSetting.show();
|
||||
}
|
||||
}
|
||||
|
||||
} );
|
||||
|
||||
headerStyleField.change( function () {
|
||||
|
||||
leftMenuSetting.hide();
|
||||
|
||||
if ( $( this ).val() == 'center' ) {
|
||||
leftMenuSetting.show();
|
||||
}
|
||||
|
||||
} );
|
||||
|
||||
// Show/hide title options
|
||||
var titleField = $( '#butterbean-control-ocean_disable_title .buttonset-input' ),
|
||||
titleMainSettings = $( '#butterbean-control-ocean_disable_heading, #butterbean-control-ocean_post_title, #butterbean-control-ocean_post_subheading, #butterbean-control-ocean_post_title_style' ),
|
||||
titleStyleField = $( '#butterbean-control-ocean_post_title_style select' ),
|
||||
titleStyleFieldVal = titleStyleField.val(),
|
||||
pageTitleBgSettings = $( '#butterbean-control-ocean_post_title_background, #butterbean-control-ocean_post_title_bg_image_position, #butterbean-control-ocean_post_title_bg_image_attachment, #butterbean-control-ocean_post_title_bg_image_repeat, #butterbean-control-ocean_post_title_bg_image_size, #butterbean-control-ocean_post_title_height, #butterbean-control-ocean_post_title_bg_overlay, #butterbean-control-ocean_post_title_bg_overlay_color' ),
|
||||
solidColorElements = $( '#butterbean-control-ocean_post_title_background_color' );
|
||||
|
||||
pageTitleBgSettings.hide();
|
||||
solidColorElements.hide();
|
||||
|
||||
if ( titleStyleFieldVal === 'background-image' ) {
|
||||
pageTitleBgSettings.show();
|
||||
} else if ( titleStyleFieldVal === 'solid-color' ) {
|
||||
solidColorElements.show();
|
||||
}
|
||||
|
||||
if ( $( '#butterbean-control-ocean_disable_title #butterbean_oceanwp_mb_settings_setting_ocean_disable_title_on' ).is( ':checked' ) ) {
|
||||
titleMainSettings.hide();
|
||||
pageTitleBgSettings.hide();
|
||||
solidColorElements.hide();
|
||||
} else {
|
||||
titleMainSettings.show();
|
||||
}
|
||||
|
||||
titleField.change( function () {
|
||||
|
||||
if ( $( this ).val() === 'on' ) {
|
||||
titleMainSettings.hide();
|
||||
pageTitleBgSettings.hide();
|
||||
solidColorElements.hide();
|
||||
} else {
|
||||
titleMainSettings.show();
|
||||
var titleStyleFieldVal = titleStyleField.val();
|
||||
|
||||
if ( titleStyleFieldVal === 'background-image' ) {
|
||||
pageTitleBgSettings.show();
|
||||
} else if ( titleStyleFieldVal === 'solid-color' ) {
|
||||
solidColorElements.show();
|
||||
}
|
||||
}
|
||||
|
||||
} );
|
||||
|
||||
titleStyleField.change( function () {
|
||||
|
||||
pageTitleBgSettings.hide();
|
||||
solidColorElements.hide();
|
||||
|
||||
if ( $( this ).val() == 'background-image' ) {
|
||||
pageTitleBgSettings.show();
|
||||
} else if ( $( this ).val() === 'solid-color' ) {
|
||||
solidColorElements.show();
|
||||
}
|
||||
|
||||
} );
|
||||
|
||||
// Show/hide breadcrumbs options
|
||||
var breadcrumbsField = $( '#butterbean-control-ocean_disable_breadcrumbs .buttonset-input' ),
|
||||
breadcrumbsSettings = $( '#butterbean-control-ocean_breadcrumbs_color, #butterbean-control-ocean_breadcrumbs_separator_color, #butterbean-control-ocean_breadcrumbs_links_color, #butterbean-control-ocean_breadcrumbs_links_hover_color' );
|
||||
|
||||
if ( $( '#butterbean-control-ocean_disable_breadcrumbs #butterbean_oceanwp_mb_settings_setting_ocean_disable_breadcrumbs_off' ).is( ':checked' ) ) {
|
||||
breadcrumbsSettings.hide();
|
||||
} else {
|
||||
breadcrumbsSettings.show();
|
||||
}
|
||||
|
||||
breadcrumbsField.change( function () {
|
||||
|
||||
if ( $( this ).val() === 'off' ) {
|
||||
breadcrumbsSettings.hide();
|
||||
} else {
|
||||
breadcrumbsSettings.show();
|
||||
}
|
||||
|
||||
} );
|
||||
|
||||
} );
|
||||
|
||||
} ) ( jQuery );
|
||||
@@ -0,0 +1 @@
|
||||
!function(f){"use strict";f(document).on("ready",function(){var e=f("#butterbean-control-ocean_post_layout select"),t=e.val(),o=f("#butterbean-control-ocean_both_sidebars_style, #butterbean-control-ocean_both_sidebars_content_width, #butterbean-control-ocean_both_sidebars_sidebars_width, #butterbean-control-ocean_second_sidebar");o.hide(),"both-sidebars"===t&&o.show(),e.change(function(){o.hide(),"both-sidebars"==f(this).val()&&o.show()});var n=f("#butterbean-control-ocean_display_header .buttonset-input"),a=f("#butterbean-control-ocean_header_style");f("#butterbean-control-ocean_display_header #butterbean_oceanwp_mb_settings_setting_ocean_display_header_off").is(":checked")?a.hide():a.show(),n.change(function(){"off"===f(this).val()?a.hide():a.show()});var c=f("#butterbean-control-ocean_header_style select"),_=c.val(),r=f("#butterbean-control-ocean_custom_header_template");r.hide(),"custom"===_&&r.show(),f("#butterbean-control-ocean_display_header #butterbean_oceanwp_mb_settings_setting_ocean_display_header_off").is(":checked")&&r.hide(),n.change(function(){"off"===f(this).val()?r.hide():"custom"===c.val()&&r.show()}),c.change(function(){r.hide(),"custom"==f(this).val()&&r.show()});var b=f("#butterbean-control-ocean_center_header_left_menu");b.hide(),"center"===_&&b.show(),f("#butterbean-control-ocean_display_header #butterbean_oceanwp_mb_settings_setting_ocean_display_header_off").is(":checked")&&b.hide(),n.change(function(){"off"===f(this).val()?b.hide():"center"===c.val()&&b.show()}),c.change(function(){b.hide(),"center"==f(this).val()&&b.show()});var s=f("#butterbean-control-ocean_disable_title .buttonset-input"),i=f("#butterbean-control-ocean_disable_heading, #butterbean-control-ocean_post_title, #butterbean-control-ocean_post_subheading, #butterbean-control-ocean_post_title_style"),l=f("#butterbean-control-ocean_post_title_style select"),h=l.val(),d=f("#butterbean-control-ocean_post_title_background, #butterbean-control-ocean_post_title_bg_image_position, #butterbean-control-ocean_post_title_bg_image_attachment, #butterbean-control-ocean_post_title_bg_image_repeat, #butterbean-control-ocean_post_title_bg_image_size, #butterbean-control-ocean_post_title_height, #butterbean-control-ocean_post_title_bg_overlay, #butterbean-control-ocean_post_title_bg_overlay_color"),u=f("#butterbean-control-ocean_post_title_background_color");d.hide(),u.hide(),"background-image"===h?d.show():"solid-color"===h&&u.show(),f("#butterbean-control-ocean_disable_title #butterbean_oceanwp_mb_settings_setting_ocean_disable_title_on").is(":checked")?(i.hide(),d.hide(),u.hide()):i.show(),s.change(function(){if("on"===f(this).val())i.hide(),d.hide(),u.hide();else{i.show();var e=l.val();"background-image"===e?d.show():"solid-color"===e&&u.show()}}),l.change(function(){d.hide(),u.hide(),"background-image"==f(this).val()?d.show():"solid-color"===f(this).val()&&u.show()});var g=f("#butterbean-control-ocean_disable_breadcrumbs .buttonset-input"),p=f("#butterbean-control-ocean_breadcrumbs_color, #butterbean-control-ocean_breadcrumbs_separator_color, #butterbean-control-ocean_breadcrumbs_links_color, #butterbean-control-ocean_breadcrumbs_links_hover_color");f("#butterbean-control-ocean_disable_breadcrumbs #butterbean_oceanwp_mb_settings_setting_ocean_disable_breadcrumbs_off").is(":checked")?p.hide():p.show(),g.change(function(){"off"===f(this).val()?p.hide():p.show()})})}(jQuery);
|
||||
Reference in New Issue
Block a user