/** * Theme customizer binding File. * * @package Articled * @since Articled 1.0 * */ (function($) { wp.customize('site_max_width', function(value) { value.bind(function(newval) { $('body .body-data').css({ 'width': newval + '%' }) }) }); wp.customize('site_inner_width', function(value) { value.bind(function(newval) { $('body .body-data .site-content').children('.container').css({ 'width': newval }) }) }); wp.customize('articled_single_thubmnail', function(value) { value.bind(function(newval) { if (newval !== !0) { $('.single-post-thumb').fadeOut() } else { $('.single-post-thumb').fadeIn() } }) }); wp.customize('articled_single_social_icons', function(value) { value.bind(function(newval) { if (newval !== !0) { $('.social-share').fadeOut() } else { $('.social-share').fadeIn() } }) }); wp.customize('articled_single_icon_type', function(value) { function conditionalDisplay(currentVal) { if (currentVal == 'icon') { $('.shareicons .fa-share-alt').fadeIn(); $('.social-share .share-it').fadeOut() } else if (currentVal == 'text') { $('.social-share .share-it').fadeIn(); $('.shareicons .fa-share-alt').fadeOut() } else { $('.social-share .share-it').fadeOut(); $('.shareicons .fa-share-alt').fadeOut() } } conditionalDisplay(value); value.bind(function(newval) { conditionalDisplay(newval) }) }); wp.customize('articled_single_tag', function(value) { value.bind(function(newval) { if (newval !== !0) { $('.single-post-tags-area').fadeOut() } else { $('.single-post-tags-area').fadeIn() } }) }); wp.customize('articled_single_tag_size', function(value) { value.bind(function(newval) { $('.single-post-tags li a').css({ 'font-size': newval }) }) }); wp.customize('articled_single_tag_padding', function(value) { value.bind(function(newval) { $('.single-post-tags li a').css({ 'padding': newval }) }) }); wp.customize('articled_single_tag_margin', function(value) { value.bind(function(newval) { $('.single-post-tags li a').css({ 'margin': newval }) }) }); wp.customize('articled_post_meta_font_size', function(value) { value.bind(function(newval) { $('.blog-post-meta').css({ 'font-size': newval }) }) }); wp.customize('articled_meta_text_color', function(value) { value.bind(function(newval) { $('.blog-post-meta').css({ 'color': newval }) }) }); wp.customize('articled_meta_link_color', function(value) { value.bind(function(newval) { $('.blog-post-meta a').css({ 'color': newval }) }) }); wp.customize('articled_post_meta', function(value) { value.bind(function(newval) { if (newval !== !0) { $('.blog-post-meta').fadeOut() } else { $('.blog-post-meta').fadeIn() } }) }); wp.customize('articled_post_format_icon', function(value) { value.bind(function(newval) { if (newval !== !0) { $('.blog-post-meta .type').fadeOut() } else { $('.blog-post-meta .type').fadeIn() } }) }); wp.customize('articled_post_meta_date', function(value) { value.bind(function(newval) { if (newval !== !0) { $('.blog-post-meta .date').fadeOut() } else { $('.blog-post-meta .date').fadeIn() } }) }); wp.customize('articled_post_meta_time', function(value) { value.bind(function(newval) { if (newval !== !0) { $('.blog-post-meta .time').fadeOut() } else { $('.blog-post-meta .time').fadeIn() } }) }); wp.customize('articled_post_meta_categories', function(value) { value.bind(function(newval) { if (newval !== !0) { $('.blog-post-meta .category').fadeOut() } else { $('.blog-post-meta .category').fadeIn() } }) }); wp.customize('articled_post_meta_comments', function(value) { value.bind(function(newval) { if (newval !== !0) { $('.blog-post-meta .comments').fadeOut() } else { $('.blog-post-meta .comments').fadeIn() } }) }); wp.customize('articled_post_meta_author', function(value) { value.bind(function(newval) { if (newval !== !0) { $('.blog-post-meta .author').fadeOut() } else { $('.blog-post-meta .author').fadeIn() } }) }); wp.customize('articled_excerpt_more_font_size', function(value) { value.bind(function(newval) { $('.index-excerpt .post-excerpt a').css({ 'font-size': newval }) }) }); wp.customize('articled_excerpt_more_color', function(value) { value.bind(function(newval) { $('.index-excerpt .post-excerpt a').css({ 'color': newval }) }) }); wp.customize('articled_continue_reading_visibility', function(value) { value.bind(function(newval) { if (newval !== !0) { $('.continue-post').fadeOut() } else { $('.continue-post').fadeIn() } }) }); wp.customize('articled_blog_social_visibility', function(value) { value.bind(function(newval) { if (newval !== !0) { $('.share-button').fadeOut() } else { $('.share-button').fadeIn() } }) }); wp.customize('articled_continue_reading', function(value) { value.bind(function(newval) { $('.continue-post .read-more').html(newval) }) }); wp.customize('articled_single_related_text', function(value) { value.bind(function(newval) { $('.related-posts-title h2').html(newval) }) }); wp.customize('articled_blog_title_size', function(value) { value.bind(function(newval) { $('.blog-post-title h2').css({ 'font-size': newval }) }) }); wp.customize('articled_excerpt_font_size', function(value) { value.bind(function(newval) { $('.index-excerpt .post-excerpt p').css({ 'font-size': newval }) }) }) })(jQuery)