/**
 * Theme Customizer enhancements for a better user experience.
 *
 * Contains handlers to make Theme Customizer preview reload changes asynchronously.
 */

(function($) {
  // Site title and description.
  wp.customize('blogname', function(value) {
    value.bind(function(to) {
      $('.site-title a').text(to);
    });
  });
  wp.customize('blogdescription', function(value) {
    value.bind(function(to) {
      $('.site-description').text(to);
    });
  });
  // Header text color.
  wp.customize('header_textcolor', function(value) {
    value.bind(function(to) {
      if ('blank' === to) {
        $('.site-title, .site-description').css({
          'clip': 'rect(1px, 1px, 1px, 1px)',
          'position': 'absolute'
        });
      } else {
        $('.site-title, .site-description').css({
          'clip': 'auto',
          'color': to,
          'position': 'relative'
        });
      }
    });
  });
  //navigation, links, titles color
  wp.customize('wabc_nav_bkg_color_setting', function(value) {
    value.bind(function(to) {
      var colors = to;
      $('body #wrapper-navbar nav .navbar-inverse, body #wrapper-footer3-widgets, body #wrapper-footer .scrollToTop, body #page #page-wrapper .container .box2, body #page #single-wrapper .container .box2, body #page #wrapper-index .container .box2, body #page #archive-wrapper .container .box2, body #page #wrapper-hero .container .box2, body #wrapper-navbar nav .navbar-inverse ul.navbar-nav li.dropdown:hover ul.dropdown-menu, body #wrapper-navbar nav .navbar-inverse ul.navbar-nav li.dropdown ul.dropdown-menu,body #wrapper-navbar nav .navbar-inverse ul.navbar-nav li.dropdown:hover ul.dropdown-menu li.dropdown-submenu:hover ul.dropdown-menu, body #wrapper-navbar nav .navbar-inverse ul.navbar-nav li.dropdown ul.dropdown-menu, body.woocommerce-page #page-wrapper .container #primary #main form.woocommerce-ordering select, body.woocommerce-page #page-wrapper .container #primary #main .product span.onsale, body.woocommerce-page #page-wrapper .container #primary ul.products li.product .button, body.woocommerce-page #page-wrapper .container #primary nav.woocommerce-pagination ul.page-numbers li span.current, body.woocommerce-page #page-wrapper .container #primary #main nav.woocommerce-pagination ul.page-numbers li a.page-numbers.next, body.woocommerce-page #page-wrapper .container #primary #main .woocommerce a.wc-backward, body #page #page-wrapper .container #primary #main form button, body.woocommerce-page #page-wrapper .container #primary #main .product .woocommerce-tabs ul.tabs li.active, body #page #page-wrapper .container #primary #main form button, body #page #page-wrapper .container #primary #main form html input[type="button"], body #page #page-wrapper .container #primary #main form input[type="reset"], body #page #page-wrapper .container #primary #main form input[type="submit"], body #page #single-wrapper .container #primary #main form button, body #page #single-wrapper .container #primary #main form html input[type="button"], body #page #single-wrapper .container #primary #main form input[type="reset"], body #page #single-wrapper .container #primary #main form input[type="submit"], body #page #wrapper-index .container #primary #main form button, body #page #wrapper-index .container #primary #main form html input[type="button"], body #page #wrapper-index .container #primary #main form input[type="reset"], body #page #wrapper-index .container #primary #main form input[type="submit"], body #page #archive-wrapper .container #primary #main form button, body #page #archive-wrapper .container #primary #main form html input[type="button"], body #page #archive-wrapper .container #primary #main form input[type="reset"], body #page #archive-wrapper .container #primary #main form input[type="submit"], body #page #wrapper-hero .container #primary #main form button, body #page #wrapper-hero .container #primary #main form html input[type="button"], body #page #wrapper-hero .container #primary #main form input[type="reset"], body #page #wrapper-hero .container #primary #main form input[type="submit"], body.woocommerce-page #page-wrapper .container #primary #main .woocommerce-message, body.woocommerce-page #page-wrapper .container #primary #main .woocommerce .woocommerce-info, body.woocommerce-page #page-wrapper .container #primary #main .woocommerce form.woocommerce-checkout #order_review .woocommerce-checkout-payment, body.woocommerce-page #page-wrapper .container #primary #main .woocommerce .cart-collaterals .cart_totals .wc-proceed-to-checkout a.checkout-button, body.woocommerce-page #page-wrapper .container #primary #main .woocommerce form.woocommerce-checkout #order_review .place-order input.button, body.woocommerce-page #page-wrapper .container #primary #main .woocommerce a.remove:hover, body #page #page-wrapper .container #primary #main nav.post-navigation .nav-links .nav-previous a, body #page #page-wrapper .container #primary #main nav.post-navigation .nav-links .nav-next a, body #page #single-wrapper .container #primary #main nav.post-navigation .nav-links .nav-previous a, body #page #single-wrapper .container #primary #main nav.post-navigation .nav-links .nav-next a, body #page #wrapper-index .container #primary #main nav.post-navigation .nav-links .nav-previous a, body #page #wrapper-index .container #primary #main nav.post-navigation .nav-links .nav-next a, body #page #archive-wrapper .container #primary #main nav.post-navigation .nav-links .nav-previous a, body #page #archive-wrapper .container #primary #main nav.post-navigation .nav-links .nav-next a, body #page #wrapper-hero .container #primary #main nav.post-navigation .nav-links .nav-previous a, body #page #wrapper-hero .container #primary #main nav.post-navigation .nav-links .nav-next a, body .btn-default, #wrapper-owl .container .wabc-slider .slide-title a').css('background-color', to);
      $('body #archive-wrapper .container header.author-header h1 ,body #search-wrapper .container article h2.entry-title a ,body #page a ,#wrapper-owl .container .wabc-slider .owl-controls .owl-buttons div,body #wrapper-top-widgets .container #TKcontent .tk-block h2.widgettitle, body #wrapper-top-widgets .container #TKcontent .tk-block .textwidget i,body #page #page-wrapper .container #primary #main article .entry-header h2.entry-title, body #page #single-wrapper .container #primary #main article .entry-header h2.entry-title, body #page #wrapper-index .container #primary #main article .entry-header h2.entry-title, body #page #archive-wrapper .container #primary #main article .entry-header h2.entry-title, body #page #wrapper-hero .container #primary #main article .entry-header h2.entry-title, body #page #page-wrapper .container .tk-block aside .title, body #page #page-wrapper .container .tk-block aside h3.widget-title, body #page #single-wrapper .container .tk-block aside .title, body #page #single-wrapper .container .tk-block aside h3.widget-title, body #page #wrapper-index .container .tk-block aside .title, body #page #wrapper-index .container .tk-block aside h3.widget-title, body #page #archive-wrapper .container .tk-block aside .title, body #page #archive-wrapper .container .tk-block aside h3.widget-title, body #page #wrapper-hero .container .tk-block aside .title, body #page #wrapper-hero .container .tk-block aside h3.widget-title, body #wrapper-footer-widgets .container #TKfootercontent .tk-block h2.widgettitle, body.woocommerce-page #page-wrapper .container #primary ul.products li.product a .star-rating span::before, body.woocommerce-page #page-wrapper .container #primary ul.products li.product a h3, body.woocommerce-page #page-wrapper .container #primary #main h1.page-title, body.woocommerce-page #page-wrapper .container #primary ul.products li.product a .star-rating span::before, body.woocommerce-page #page-wrapper .container #primary #main .product .summary h1.product_title, body.woocommerce-page #page-wrapper .container #primary #main .woocommerce .cart-collaterals .cross-sells h2, body.woocommerce-page #page-wrapper .container #primary #main .woocommerce .cart-collaterals .cart_totals h2, body.woocommerce-page #page-wrapper .container #primary #main .woocommerce a.remove, body.woocommerce-page #page-wrapper .container #primary #main .product .woocommerce-tabs .panel h2, body.woocommerce-page #page-wrapper .container #primary #main .product .upsells h2, body.woocommerce-page #page-wrapper .container #primary #main .product .related h2, body.woocommerce-page #page-wrapper .container #primary #main .woocommerce form.login p.form-row label.inline, body #page #page-wrapper .container #tkhero aside .title, body #page #page-wrapper .container #tkhero aside h3.widget-title, body #page #single-wrapper .container #tkhero aside .title, body #page #single-wrapper .container #tkhero aside h3.widget-title, body #page #wrapper-index .container #tkhero aside .title, body #page #wrapper-index .container #tkhero aside h3.widget-title, body #page #archive-wrapper .container #tkhero aside .title, body #page #archive-wrapper .container #tkhero aside h3.widget-title, body #page #wrapper-hero .container #tkhero aside .title, body #page #wrapper-hero .container #tkhero aside h3.widget-title, body #page #middle-widgets-wrapper .container #TKMiddlecontent .tk-block h2.widgettitle, body #page #page-wrapper .container #primary #main header.page-header h1.page-title, body #page #single-wrapper .container #primary #main header.page-header h1.page-title, body #page #wrapper-index .container #primary #main header.page-header h1.page-title, body #page #archive-wrapper .container #primary #main header.page-header h1.page-title, body #page #wrapper-hero .container #primary #main header.page-header h1.page-title, body #page #page-wrapper .container #primary #main header.page-header h1.page-title, body #page #single-wrapper .container #primary #main header.page-header h1.page-title, body #page #wrapper-index .container #primary #main header.page-header h1.page-title, body #page #archive-wrapper .container #primary #main header.page-header h1.page-title, body #page #wrapper-hero .container #primary #main header.page-header h1.page-title,body #wrapper-index .container article .entry-meta span.posted-on a, body #page-wrapper .container article .entry-meta span.posted-on a, body #single-wrapper .container article .entry-meta span.posted-on a, body #archive-wrapper .container article .entry-meta span.posted-on a,   body #wrapper-index .container article .entry-meta span.byline a, body #page-wrapper .container article .entry-meta span.byline a, body #single-wrapper .container article .entry-meta span.byline a, body #archive-wrapper .container article .entry-meta span.byline a,   body #wrapper-index .container article footer.entry-footer span.cat-links a, body #page-wrapper .container article footer.entry-footer span.cat-links a, body #single-wrapper .container article footer.entry-footer span.cat-links a, body #archive-wrapper .container article footer.entry-footer span.cat-links a, body #wrapper-index .container article footer.entry-footer span.comments-link a, body #page-wrapper .container article footer.entry-footer span.comments-link a, body #single-wrapper .container article footer.entry-footer span.comments-link a, body #archive-wrapper .container article footer.entry-footer span.comments-link a, body #wrapper-index .container article footer.entry-footer span.tags-links a, body #page-wrapper .container article footer.entry-footer span.tags-links a, body #single-wrapper .container article footer.entry-footer span.tags-links a, body #archive-wrapper .container article footer.entry-footer span.tags-links a, body a, body #wrapper-index .container article h2.entry-title a, body #page-wrapper .container article h2.entry-title a, body #single-wrapper .container article h2.entry-title a, body #archive-wrapper .container article h2.entry-title a, body #wrapper-index .container article h2.entry-title a:hover, body #page-wrapper .container article h2.entry-title a:hover, body #single-wrapper .container article h2.entry-title a:hover, body #archive-wrapper .container article h2.entry-title a:hover').css('color', to);
      $('a.btn.btn-default.wabc-read-more-link,body #page #page-wrapper .container #primary #main article blockquote, body #page #single-wrapper .container #primary #main article blockquote, body #page #wrapper-index .container #primary #main article blockquote, body #page #archive-wrapper .container #primary #main article blockquote, body #page #wrapper-hero .container #primary #main article blockquote, body .btn-default').css('border-color', to);
      $('body #wrapper-footer .footer-social-links ul.footer-social li a,body #page #wrapper-top-pages .container #TKcontent-pages .tk-block a.btn.btn-default.wabc-read-more-link,body #page #wrapper-showcase-pages .container #TKcontent-showcase-pages .tk-block a.btn.btn-default.wabc-read-more-link,body #page #wrapper-middle-pages .container #TKMiddlecontent-pages .tk-block a.btn.btn-default.wabc-read-more-link').css('color' ,' #FFFFFF');
      $('body .btn-default').css('color','#FFFFFF');



    })
  });
  //Footer background color settings
  wp.customize('wabc_footer_bkg_color_setting', function(value) {
    value.bind(function(to) {
      $('body #wrapper-footer').css('background-color', to);

    })
  });

})(jQuery);
