/* * Widget scripts * Description: Custom scripts for Widgets Page */ jQuery(document).ready(function($){ post_type = $( '.ct_feat_post_post_type' ); post_type.change(function(){ post_type_val = $(this).val(); post_id = $(this).parent().next(); multi_cat_id = $(this).parent().next().next(); post_no_id = $(this).parent().next().next().next(); if( 'all-categories' == post_type_val ) { post_id.hide(); multi_cat_id.hide(); post_no_id.show(); } else if( 'id' == post_type_val ) { post_id.show(); multi_cat_id.hide(); post_no_id.hide(); } else if( 'select-category' == post_type_val ) { post_id.hide(); multi_cat_id.show(); post_no_id.show(); } return false; }); disable_image = $( '.ct_feat_post_disable_image' ); disable_image.change(function(){ image_alignment = $(this).parent().next(); image_size = $(this).parent().next().next(); if( $(this).is(':checked') ) { image_alignment.hide(); image_size.hide(); } else { image_alignment.show(); image_size.show(); } return false; }); content_type = $( '.ct_feat_post_content_type' ); content_type.change(function(){ content_type_val = $(this).val(); content_limit = $(this).next().next(); if( 'content-limit' == content_type_val ) { content_limit.show(); } else { content_limit.hide(); } return false; }); });