1;(function($) { 2 3 "use strict"; 4 5 var responsive_menu = function() { 6 7 $('.tf-nav-menu').each(function(){ 8 var $this = $(this).data('id_random'), 9 $tf_nav_menu = $('.'+$this), 10 $btn_menu_mobile = $('.'+$this).find('.btn-menu-mobile'), 11 $close_menu_panel_style_default = $('.'+$this).find('.close-menu-panel-style-default'), 12 $btn_menu_only = $('.'+$this).find('.btn-menu-only'), 13 $mobile_menu_overlay = $('.'+$this).find('.mobile-menu-overlay'), 14 $mobile_menu_close = $('.'+$this).find('.tf-close'); 15 16 $('.'+$this).find('.btn-submenu').remove(); 17 var hasChildMenu = $tf_nav_menu.find('.mainnav-mobi').find('li:has(ul)'); 18 hasChildMenu.children('ul').hide(); 19 hasChildMenu.children('a').after('<span class="btn-submenu"><i class="fa fa-angle-down" aria-hidden="true"></i></span>'); 20 21 var menuType = 'desktop'; 22 $(window).on('load resize', function() { 23 var currMenuType = 'desktop'; 24 25 if ( matchMedia( 'only screen and (max-width: 991px)' ).matches ) { 26 currMenuType = 'mobile'; 27 } 28 29 if ( currMenuType !== menuType ) { 30 menuType = currMenuType; 31 } else { 32 $('.'+$this).find('.mobile-menu-overlay').removeClass('active'); 33 $('.'+$this).find('.nav-panel').removeClass('active'); 34 } 35 36 }); 37 38 $(document).on('click', '.mainnav-mobi li .btn-submenu', function(e) { 39 $(this).toggleClass('active').next('ul').slideToggle(300); 40 e.stopImmediatePropagation(); 41 e.preventDefault(); 42 }); 43 44 //Open Nav 45 $($btn_menu_mobile).on('click', function() { 46 $(this).addClass('active'); 47 $(this).siblings().addClass('active'); 48 }); 49 50 //Close Nav 51 $($close_menu_panel_style_default).on('click', function() { 52 $(this).closest('.nav-panel').removeClass('active'); 53 $(this).closest('.nav-panel').siblings().removeClass('active'); 54 }); 55 56 $($mobile_menu_overlay).on('click', function() { 57 $(this).siblings().removeClass('active'); 58 $(this).removeClass('active'); 59 }); 60 61 $($mobile_menu_close).on('click', function() { 62 $(this).siblings().removeClass('active'); 63 $(this).removeClass('active'); 64 }); 65 66 $($btn_menu_only).on('click', function() { 67 $(this).siblings().addClass('active'); 68 }); 69 70 71 72 }); 73 74 } 75 76 var carousel_Box = function() { 77 if ( $().owlCarousel ) { 78 $('.tf-carousel-box').each(function(){ 79 var 80 $this = $(this), 81 item = $this.data("column"), 82 item2 = $this.data("column2"), 83 item3 = $this.data("column3"), 84 spacer = Number($this.data("spacer")), 85 prev_icon = $this.data("prev_icon"), 86 next_icon = $this.data("next_icon"); 87 88 var loop = false; 89 if ($this.data("loop") == 'yes') { 90 loop = true; 91 } 92 93 var arrow = false; 94 if ($this.data("arrow") == 'yes') { 95 arrow = true; 96 } 97 98 var auto = false; 99 if ($this.data("auto") == 'yes') { 100 auto = true; 101 } 102 103 $this.find('.owl-carousel').owlCarousel({ 104 loop: loop, 105 margin: spacer,
106 nav: true, 107 pagination: true, 108 autoplay: auto, 109 autoplayTimeout: 5000, 110 smartSpeed: 850, 111 autoplayHoverPause: true, 112 navText : ["<i class=\""+prev_icon+"\"></i>","<i class=\""+next_icon+"\"></i>"], 113 responsive: { 114 0:{ 115 items:item3 116 }, 117 768:{ 118 items:item2 119 }, 120 1000:{ 121 items:item 122 } 123 } 124 }); 125 }); 126 } 127 } 128 129 var onepage_nav = function () { 130 $('.tf-nav-menu.has-one-page .mainnav > ul > li > a').on('click',function(e) { 131 132 var anchor = $(this).attr('href').split('#')[1]; 133 var largeScreen = matchMedia('only screen and (min-width: 992px)').matches; 134 var headerHeight = 0; 135 headerHeight = $('.header').height(); 136 if ( anchor ) { 137 if ( $('#'+anchor).length > 0 ) { 138 if ( $('.header-shadow').length > 0 ) { 139 headerHeight = headerHeight; 140 } else { 141 headerHeight = 0; 142 } 143 var target = $('#'+anchor).offset().top - headerHeight; 144 $('html,body').animate({scrollTop: target}, 1000, 'easeInOutExpo'); 145 } 146 } 147 148 e.preventDefault(); 149 150 }); 151 } 152 153 var search_form = function(){ 154 $('.tf-widget-search').each(function(){ 155 $(this).find('.tf-icon-search').on('click' , function(){ 156 $(this).siblings('.tf-modal-search-panel').addClass('show'); 157 }); 158 }); 159 $(document).on('click', '.tf-widget-search .tf-modal-search-panel', function() { 160 $(this).removeClass('show'); 161 }); 162 $(document).on('click', '.tf-widget-search .tf-search-form', function(e) { 163 e.stopImmediatePropagation(); 164 }); 165 }; 166 167 var customizable_carousel = function() { 168 var owl_carousel = $("div.customizable-carousel"); 169 if (owl_carousel.length > 0) { 170 owl_carousel.each(function() { 171 var $this = $(this), 172 $items = ($this.data('items')) ? $this.data('items') : 1, 173 $loop = ($this.attr('data-loop')) ? $this.data('loop') : true, 174 $navdots = ($this.data('nav-dots')) ? $this.data('nav-dots') : false, 175 $navarrows = ($this.data('nav-arrows')) ? $this.data('nav-arrows') : false, 176 $autoplay = ($this.attr('data-autoplay')) ? $this.data('autoplay') : false, 177 $autospeed = ($this.attr('data-autospeed')) ? $this.data('autospeed') : 3500, 178 $smartspeed = ($this.attr('data-smartspeed')) ? $this.data('smartspeed') : 950, 179 $autohgt = ($this.data('autoheight')) ? $this.data('autoheight') : false, 180 $space = ($this.attr('data-space')) ? $this.data('space') : 15; 181 182 $(this).owlCarousel({ 183 loop: $loop, 184 items: $items, 185 responsive: { 186 0: { 187 items: ($this.data('xs-items')) ? $this.data('xs-items') : 1 188 }, 189 600: { 190 items: ($this.data('sm-items')) ? $this.data('sm-items') : 2, 191 nav: false 192 }, 193 1000: { 194 items: ($this.data('md-items')) ? $this.data('md-items') : 3 195 }, 196 1240:{ 197 items: $items 198 } 199 }, 200 dots: $navdots, 201 autoplayTimeout: $autospeed, 202 smartSpeed: $smartspeed, 203 autoHeight: $autohgt, 204 margin: $space, 205 nav: $navarrows, 206 autoplay: $autoplay, 207 autoplayHoverPause: true 208 }); 209 }); 210 } 211 }; 212 213 var blogPostsOwl = function() { 214 if ( $().owlCarousel ) { 215 $('.themesflat_sc_vc-blog-post.has-carousel').each(function(){ 216 var 217 $this = $(this),
218 item = $this.data("column"), 219 item2 = $this.data("column2"), 220 item3 = $this.data("column3"), 221 spacer = Number($this.data("spacer")), 222 prev_icon = $this.data("prev_icon"), 223 next_icon = $this.data("next_icon"); 224 225 var loop = false; 226 if ($this.data("loop") == 'yes') { 227 loop = true; 228 } 229 230 var arrow = false; 231 if ($this.data("arrow") == 'yes') { 232 arrow = true; 233 } 234 235 var auto = false; 236 if ($this.data("auto") == 'yes') { 237 auto = true; 238 } 239 240 $this.find('.template.owl-carousel').owlCarousel({ 241 loop: loop, 242 margin: spacer, 243 nav: true, 244 pagination: false, 245 autoplay: auto, 246 autoplayTimeout: 5000, 247 autoplayHoverPause: true, 248 animateIn: 'fadeIn', 249 animateOut: 'fadeOut', 250 navText : ["<i class=\""+prev_icon+"\"></i>","<i class=\""+next_icon+"\"></i>"], 251 responsive: { 252 0:{ 253 items:item3 254 }, 255 768:{ 256 items:item2 257 }, 258 1000:{ 259 items:item 260 } 261 } 262 }); 263 }); 264 } 265 } 266 267 var blogPostsGallery = function() { 268 $(".featured-image-gallery").each(function() { 269 var $this = $(this); 270 var animation = $this.data('animation_images'), 271 autoplay = $this.data('autoplay'), 272 slideshowSpeed = $this.data('slideshowSpeed'), 273 controlNav = $this.data('controlnav'), 274 directionNav = $this.data('directionnav'), 275 prevText = $this.data('prevtext'), 276 nextText = $this.data('nexttext'); 277 $this.flexslider({ 278 animation: animation, 279 slideshow: autoplay, 280 slideshowSpeed: slideshowSpeed, 281 animationSpeed: 1000, 282 animationLoop: true, 283 controlNav: controlNav, 284 directionNav: directionNav, 285 prevText: '<i class="' + prevText + '" aria-hidden="true"></i>', 286 nextText: '<i class="' + nextText + '" aria-hidden="true"></i>', 287 useCCS: false 288 }); 289 }); 290 } 291 292 var blogLoadMore = function() { 293 294 var $container = $('.themesflat_sc_vc-blog-post .wrap-blog-article .template'); 295 296 $('.themesflat_sc_vc-blog-post .navigation.loadmore a').on('click', function(e) { 297 e.preventDefault(); 298 var $item = '.item'; 299 300 $('<span/>', { 301 class: 'infscr-loading', 302 text: 'Loading...', 303 }).appendTo($container); 304 305 $.ajax({
306 type: "GET", 307 url: $(this).attr('href'), 308 dataType: "html", 309 success: function( out ) { 310 var result = $(out).find($item); 311 var nextlink = $(out).find('.navigation.loadmore a').attr('href'); 312 313 result.css({ opacity: 0 }); 314 if ($container.hasClass('blog-masonry')) { 315 $container.append(result).imagesLoaded(function () { 316 result.css({ opacity: 1 }); 317 $container.masonry('appended', result); 318 }); 319 } 320 else { 321 result.css({ opacity: 1 }); 322 $container.append(result); 323 } 324 325 if ( nextlink != undefined ) { 326 $('.navigation.loadmore a').attr('href', nextlink); 327 $container.find('.infscr-loading').remove(); 328 } else { 329 $container.find('.infscr-loading').addClass('no-ajax').text('All posts loaded.').delay(2000).queue(function() {$(this).remove();}); 330 $('.navigation.loadmore a').remove(); 331 } 332 customizable_carousel(); 333 postFormatIziModal(); 334 } 335 }) 336 }) 337 } 338 339 340 var blogMasonry = function() { 341 $('.themesflat_sc_vc-blog-post .wrap-blog-article .template').each(function(){ 342 var $this = $(this); 343 if ($this.hasClass('masonry')) { 344 var $grid = $this.isotope({ 345 itemSelector: '.column', 346 percentPosition: true, 347 masonry: { 348 columnWidth: '.template' 349 } 350 }); 351 352 $grid.imagesLoaded().progress( function() { 353 $grid.isotope('layout'); 354 }); 355 } 356 }); 357 } 358 359 var tftabs = function() { 360 361 $('.tf-tabs').each( function() { 362 363 $(this).find('.tf-tabnav ul > li').filter(':first').addClass('active').removeClass('inactive'); 364 $(this).find('.tf-tabcontent').children().filter(':first').addClass('active'); 365 366 367 if ( $(this).find('.tf-tabnav ul > li').hasClass('set-active-tab') ) { 368 $(this).find('.tf-tabnav ul > li').siblings().removeClass('active'); 369 } 370 if ( $(this).find('.tf-tabcontent').children().hasClass('set-active-tab') ) { 371 $(this).find('.tf-tabcontent').children().siblings().removeClass('active'); 372 } 373 374 $(this).find('.tf-tabnav ul > li').on('click', function(){ 375 var tab_id = $(this).attr('data-tab'); 376 377 $(this).siblings().removeClass('active').removeClass('set-active-tab').addClass('inactive'); 378 $(this).closest('.tf-tabs').find('.tf-tabcontent').children().removeClass('active').removeClass('set-active-tab').addClass('inactive'); 379 380 $(this).addClass('active').removeClass('inactive'); 381 $(this).closest('.tf-tabs').find('.tf-tabcontent').children('#'+tab_id).addClass('active').removeClass('inactive'); 382 }); 383 }); 384 } 385 386 var vegasSlider = function() { 387 $(".hero-section").each(function() { 388 var 389 contentTopMargin = 0, 390 heroHeight = 0, 391 customHeight = 0, 392 hero = $(this), 393 windowHeight = $(window).height(), 394 heroContent = hero.find('.vegas-content'), 395 contentHeight = heroContent.height(), 396 delay = Number(hero.data('delay')), 397 spacing = hero.data('content'), 398 slide_type = hero.data('slide_type'), 399 customHeight = hero.data('height'); 400 var customHeightTablet = hero.data('height_tablet'); 401 var customHeightMobile = hero.data('height_mobile'); 402 403 if ( slide_type == 'full-height' ) { 404 heroHeight = windowHeight; 405 }else { 406 heroHeight = customHeight; 407 if ( matchMedia( 'only screen and (max-width: 991px)' ).matches ) { 408 heroHeight = customHeightTablet; 409 } 410 if ( matchMedia( 'only screen and (max-width: 767px)' ).matches ) { 411 heroHeight = customHeightMobile; 412 } 413 } 414 415 if ( slide_type == 'full-height' ) { 416 hero.css({ height: heroHeight + "px" }); 417 contentTopMargin = ((heroHeight - contentHeight) / 2) + spacing; 418 heroContent.css("padding-top", (contentTopMargin) + "px"); 419 }else { 420 hero.css({ height: heroHeight + "px" }); 421 contentTopMargin = ((heroHeight - contentHeight) / 2) + spacing; 422 heroContent.css("padding-top", (contentTopMargin) + "px"); 423 } 424 425 if ( $().vegas ) { 426 $(".hero-section.slidehero").each(function() { 427 var 428 $this = $(this), 429 count = $this.data('count'), 430 count = parseInt(count,10), 431 effect = $this.data('effect'), 432 images = $this.data('image'), 433 cOverlay = $this.data('overlay'), 434 pOverlay = $this.data('poverlay'), 435 i = 0, 436 slides = [], 437 imgs = images.split('|'); 438 while ( i < count ) { 439 slides.push( {src:imgs[i]} ); 440 i++; 441 } 442 $this.vegas({ 443 slides: slides, 444 overlay: true, 445 transition: effect, 446 delay: delay, 447 });
448 var overlay = $('<div />', { 449 class: 'overlay', 450 style: 'background:' + cOverlay 451 }); 452 $(this).append(overlay).find('.vegas-overlay').addClass(pOverlay); 453 }); 454 } 455 if ( $().YTPlayer ) { 456 $(".hero-section.slidevideo").each(function() { 457 var 458 $this = $(this), 459 cOverlay = $this.data('overlay'), 460 overlay = $('<div />', { 461 class: 'overlay', 462 style: 'position: absolute; width: 100%; height: 100%; background:' + cOverlay 463 }); 464 $this.YTPlayer().append(overlay); 465 }); 466 } 467 if ( $('.slide-fancy-text').is('.scroll') ) { 468 $('.slide-fancy-text.scroll').each(function() { 469 var 470 $this = $(this), 471 current = 1, 472 height = $this.children('.heading').height(), 473 numberDivs = $this.children().length, 474 first = $this.children('.heading:nth-child(1)'); 475 $this.height(height); 476 $this.siblings('.prefix-text, .suffix-text').height(height); 477 setInterval(function() { 478 var number = current * -height; 479 first.css('margin-top', number + 'px'); 480 if ( current === numberDivs ) { 481 first.css('margin-top', '0px'); 482 current = 1; 483 } else current++; 484 }, delay); 485 }); 486 } 487 if ( $('.slide-fancy-text').is('.typed') ) { 488 if ( $().typed ) { 489 $('.slide-fancy-text.typed').each(function() { 490 var 491 $this = $(this), 492 texts = $this.data('fancy').split(','); 493 $this.find('.text').typed({ 494 strings: texts, 495 typeSpeed: 40, 496 loop:true, 497 backDelay: delay 498 }); 499 }); 500 } 501 } 502 }); 503 $(".hero-section").each(function() { 504 var $this = $(this); 505 $this.find('.scroll-target').on('click',function() { 506 var anchor = $(this).attr('href').split('#')[1]; 507 if ( anchor ) { 508 if ( $('#'+anchor).length > 0 ) { 509 var headerHeight = 0; 510 if ( $('body').hasClass('header-sticky') ) { 511 headerHeight = $('#site-header').height(); 512 } 513 var target = $('#' + anchor).offset().top - headerHeight; 514 if ( $('body').hasClass('admin-bar') ) { 515 var wpadminbar = $('#wpadminbar').height(); 516 target = $('#' + anchor).offset().top - headerHeight - wpadminbar; 517 } 518 $('html,body').animate({scrollTop: target}, 1000, 'easeInOutExpo'); 519 } 520 } 521 return false; 522 }); 523 }); 524 }; 525 526 var flexSlider = function() { 527 $(".flexslider").each(function() { 528 var $this = $(this), 529 adminBarHeight = 0, 530 topBarHeight = 0, 531 contentTopMargin = 0, 532 adminBar = $('#wpadminbar'), 533 topBar = $('#top-bar'), 534 headerHeight = $('header').height(), 535 flexsliderHeight = $this.data('height'), 536 flexsliderHeightTablet = $this.data('height_tablet'), 537 flexsliderHeightMobile = $this.data('height_mobile'), 538 flexSliderContent = $this.find('.flex_caption'), 539 contentHeight = flexSliderContent.outerHeight(); 540 if ( matchMedia( 'only screen and (max-width: 991px)' ).matches ) { 541 flexsliderHeight = flexsliderHeightTablet; 542 } 543 if ( matchMedia( 'only screen and (max-width: 767px)' ).matches ) { 544 flexsliderHeight = flexsliderHeightMobile; 545 } 546
547 $this.find('.item-slide').height(flexsliderHeight); 548 if (topBar.length) topBarHeight = topBar.height(); 549 if (adminBar.length) adminBarHeight = adminBar.height(); 550 551 if (contentHeight == 0) { 552 contentHeight = (flexsliderHeight * 0.5); 553 } 554 555 if ( $this.hasClass('header-absolute') ) { 556 contentTopMargin = ((flexsliderHeight + topBarHeight + headerHeight - contentHeight ) / 2); 557 flexSliderContent.css("margin-top", (contentTopMargin) + "px"); 558 } else { 559 contentTopMargin = ((flexsliderHeight - contentHeight ) / 2); 560 flexSliderContent.css("margin-top", (contentTopMargin) + "px"); 561 } 562 563 var animation = $this.data('animation_images'), 564 autoplay = $this.data('autoplay'), 565 slideshowSpeed = $this.data('slideshowSpeed'), 566 controlNav = $this.data('controlnav'), 567 directionNav = $this.data('directionnav'), 568 prevText = $this.data('prevtext'), 569 nextText = $this.data('nexttext'); 570 $this.flexslider({ 571 animation: 'fade', 572 slideshow: autoplay, 573 slideshowSpeed: slideshowSpeed, 574 animationSpeed: 1000, 575 animationLoop: true, 576 controlNav: controlNav, 577 directionNav: directionNav, 578 prevText: '<i class="' + prevText + '" aria-hidden="true"></i>', 579 nextText: '<i class="' + nextText + '" aria-hidden="true"></i>', 580 useCCS: false 581 }); 582 }); 583 } 584 585 var postFormatIziModal = function(){ 586 if ($('body').find('div').hasClass('izimodal')) { 587 $(".izimodal").iziModal({ 588 width: 850, 589 top: null, 590 bottom: null, 591 borderBottom: false, 592 padding: 0, 593 radius: 3, 594 zindex: 999999, 595 iframe: false, 596 iframeHeight: 400, 597 iframeURL: null, 598 focusInput: false, 599 group: '', 600 loop: false, 601 arrowKeys: true, 602 navigateCaption: true, 603 navigateArrows: true, // Boolean, 'closeToModal', 'closeScreenEdge' 604 history: false, 605 restoreDefaultContent: true, 606 autoOpen: 0, // Boolean, Number 607 bodyOverflow: false, 608 fullscreen: false, 609 openFullscreen: false, 610 closeOnEscape: true, 611 closeButton: true, 612 appendTo: 'body', // or false 613 appendToOverlay: 'body', // or false 614 overlay: true, 615 overlayClose: true, 616 overlayColor: 'rgba(0, 0, 0, .7)', 617 timeout: false, 618 timeoutProgressbar: false, 619 pauseOnHover: false, 620 timeoutProgressbarColor: 'rgba(255,255,255,0)', 621 transitionIn: 'comingIn', 622 transitionOut: 'comingOut', 623 transitionInOverlay: 'fadeIn', 624 transitionOutOverlay: 'fadeOut', 625 onFullscreen: function(){}, 626 onResize: function(){}, 627 onOpening: function(){}, 628 onOpened: function(){}, 629 onClosing: function(){}, 630 onClosed: function(){}, 631 afterRender: function(){} 632 }); 633 634 $(document).on('click', '.trigger', function (event) { 635 event.preventDefault(); 636 $('.izimodal').iziModal('setZindex', 99999999); 637 $('.izimodal').iziModal('open', { zindex: 99999999 }); 638 $('.izimodal').iziModal('open'); 639 }); 640 } 641 } 642 643 /* Woo 644 ------------------------------------*/ 645 var productCarousel = function() { 646 if ( $().owlCarousel ) { 647 $('.tf-woo-product.carousel-yes').each(function(){ 648 var 649 $this = $(this),
650 item = $this.data("column"), 651 item2 = $this.data("column2"), 652 item3 = $this.data("column3"), 653 spacer = Number($this.data("spacer")), 654 prev_icon = $this.data("prev_icon"), 655 next_icon = $this.data("next_icon"); 656 657 var loop = false; 658 if ($this.data("loop") == 'yes') { 659 loop = true; 660 } 661 662 var arrow = false; 663 if ($this.data("arrow") == 'yes') { 664 arrow = true; 665 } 666 667 var auto = false; 668 if ($this.data("auto") == 'yes') { 669 auto = true; 670 } 671 672 673 $this.find('.owl-carousel.owl-theme').owlCarousel({ 674 loop: loop, 675 margin: spacer, 676 nav: true, 677 pagination: true, 678 autoplay: auto, 679 autoplayTimeout: 5000, 680 smartSpeed: 850, 681 autoplayHoverPause: true, 682 navText : ["<i class=\""+prev_icon+"\"></i>","<i class=\""+next_icon+"\"></i>"], 683 responsive: { 684 0:{ 685 items:item3 686 }, 687 768:{ 688 items:item2 689 }, 690 1000:{ 691 items:item 692 } 693 } 694 }); 695 }); 696 } 697 } 698 699 var productLoadMore = function() { 700 var $container_wrap = $('.tf-woo-product'); 701 var $container = $('.tf-woo-product').find('.products'); 702 var $products = $container.find('.products > .product-item'); 703 704 $('.navigation.loadmore a').on('click', function(e) { 705 e.preventDefault(); 706 707 $(this).closest('.navigation.loadmore').addClass('loading'); 708 709 $.ajax({
710 type: "GET", 711 url: $(this).attr('href'), 712 dataType: "html", 713 success: function( out ) { 714 var result = $(out).find('.product-item'); 715 var nextlink = $(out).find('.navigation.loadmore a').attr('href'); 716 717 if (result.length) { 718 for (var index = 0; index < result.length; index++) { 719 $(result[index]).css('animation-delay', index * 100 + 'ms'); 720 } 721 result.addClass('soberFadeInUp soberAnimation'); 722 } 723 724 $container.each(function() { 725 $(this).append(result).imagesLoaded(function () { 726 setTimeout(function() { 727 $container.isotope('appended', result); 728 }, index * 100); 729 }); 730 }); 731 732 $('.navigation.loadmore').removeClass('loading'); 733 734 if ( nextlink != undefined ) { 735 $('.navigation.loadmore a').attr('href', nextlink); 736 } else { 737 $('.navigation.loadmore').remove(); 738 } 739 } 740 }); 741 }); 742 } 743 744 var productFilterForm = function() { 745 $(window).on('load resize', function() { 746 $('.tf-woo-product').each(function(){ 747 if ( $(this).hasClass('show_filter_product') ) { 748 var $wrap_container = $(this); 749 var $container = $(this).find('.products'); 750 var loading = '<span class="loading-icon"><span class="bubble"><span class="dot"></span></span><span class="bubble"><span class="dot"></span></span><span class="bubble"><span class="dot"></span></span></span>'; 751 752 $wrap_container.find('.shop-columns').on('click', function() { 753 $(this).siblings('.shop-columns').removeClass('active'); 754 $(this).addClass('active'); 755 var $data_columns = $(this).attr('data-columns'); 756 $wrap_container.find('.products').append(loading); 757 $wrap_container.find(".products").attr('class', function(i, c){ 758 setTimeout(function() { 759 $wrap_container.find('.products .loading-icon').fadeOut('slow', function(){ 760 setTimeout(function() { 761 $wrap_container.find('.products .loading-icon').remove(); 762 }, 500); 763 }); 764 }, 700); 765 return c.replace(/(^|\s)columns-\S+/g, ' columns-'+$data_columns); 766 }); 767 }); 768 769 $('.toggle-filter-form').on('click', function() { 770 $(this).siblings('.wrap-form-filter').fadeIn(); 771 }); 772 $('.wrap-form-filter .widget-title .close').on('click', function() { 773 $(this).closest('.wrap-form-filter').fadeOut(); 774 }); 775 776 $('#form_filter .filter-button').on('click', function() { 777 $wrap_container.find('.products').append(loading); 778 }); 779 780 $('#form_filter').submit(function(){ 781 var form_filter = $(this); 782 783 $.ajax({
784 url:form_filter.attr('action'), 785 data:form_filter.serialize(), // form data 786 type:form_filter.attr('method'), // POST 787 beforeSend:function(xhr){ 788 form_filter.find('button').text('Processing...'); // changing the button label 789 }, 790 success:function(data){ 791 var numItems = $(data).filter('.product-item').length; 792 $wrap_container.find('.toolbar-control .woocommerce-result-count').text(numItems + ' products'); 793 form_filter.find('button').text('Filter'); // changing the button label back 794 $wrap_container.find('.content-tab .content-tab-inner.active .products').html(data).hide().fadeIn('slow'); // insert data 795 796 $wrap_container.find('.products .loading-icon').fadeOut('slow', function(){ 797 setTimeout(function() { 798 $wrap_container.find('.products .loading-icon').remove(); 799 },1000); 800 }); 801 } 802 }); 803 return false; 804 }); 805 806 }; 807 }); 808 }); 809 }; 810 811 var productFilterTabs = function() { 812 $('.show_filter_product').each(function() { 813 var $wrap_container = $(this).closest('.tf-woo-product'); 814 var loading = '<span class="loading-icon"><span class="bubble"><span class="dot"></span></span><span class="bubble"><span class="dot"></span></span><span class="bubble"><span class="dot"></span></span></span>'; 815 $(this).children('.content-tab').children().hide(); 816 $(this).children('.content-tab').children().first().show().addClass('active'); 817 $(this).find('.products-filter').children('li').on('click', function(e) { 818 $wrap_container.find('.products').append(loading); 819 var datafilter = $(this).attr('data-filter'); 820 $(this).closest('.tf-woo-product').find('#form_filter #product_tab_badge').val(datafilter); 821 822 var liActive = $(this).index(), 823 contentActive = $(this).siblings().removeClass('active').parents('.show_filter_product').children('.content-tab').children().eq(liActive); 824 825 contentActive.addClass('active').fadeIn('slow'); 826 var numItems = contentActive.find('.products').children('.product-item').length; 827 $(this).closest('.filter-bar').find('.toolbar-control .woocommerce-result-count').text(numItems + ' products'); 828 829 contentActive.siblings().removeClass('active'); 830 $(this).addClass('active').parents('.show_filter_product').children('.content-tab').children().eq(liActive).siblings().hide(); 831 e.preventDefault(); 832 833 setTimeout(function() { 834 $wrap_container.find('.products .loading-icon').fadeOut('', function(){ 835 setTimeout(function() { 836 $wrap_container.find('.products .loading-icon').remove(); 837 }, 500); 838 }); 839 }, 700); 840 841 }); 842 }); 843 }; 844 845 var productSingleImage = function() { 846 $('.tf-woo-product-single-image').each(function(){ 847 $(this).find('#image-carousel').flexslider({ 848 animation: "slide", 849 controlNav: false, 850 animationLoop: true, 851 slideshow: true, 852 itemWidth: 277, 853 itemMargin: 20, 854 asNavFor: $(this).find('#image-flexslider'), 855 prevText: '<i class="fa fa-angle-left"></i>', 856 nextText: '<i class="fa fa-angle-right"></i>' 857 }); 858 $(this).find('#image-flexslider').flexslider({ 859 animation: "slide", 860 controlNav: false, 861 animationLoop: true, 862 slideshow: true, 863 sync: $(this).find('#image-carousel'), 864 directionNav: false, 865 prevText: '<i class="fa fa-angle-left"></i>', 866 nextText: '<i class="fa fa-angle-right"></i>' 867 }); 868 }); 869 }; 870 871 var cavas_product_mini_cart = function() { 872 $('#mini-cart-click, #mini-cart-click a, .products .ajax_add_to_cart').on('click', function(e){ 873 $('#canvas-mini-cart').addClass('canvas-cart-open'); 874 $('.mini-cart .overlay-mini-cart').addClass('canvas-overlay-open'); 875 e.preventDefault(); 876 }); 877 878 $('.mini-cart .overlay-mini-cart, #canvas-mini-cart .cart-close').on('click', function(e){ 879 $('#canvas-mini-cart').removeClass('canvas-cart-open'); 880 $('.mini-cart .overlay-mini-cart').removeClass('canvas-overlay-open'); 881 e.preventDefault(); 882 }); 883 } 884 885 /* Sticky 886 ------------------------------------*/
887 var TF_Sticky = function() { 888 var wpadminbar = $('#wpadminbar').outerHeight(); 889 $('.tf-sticky-section').each(function() { 890 var section = $(this), 891 section_id = section.data('id'); 892 893 if (section.hasClass('tf-sticky-yes')) { 894 var class_section = $('.elementor-element-'+section_id+'.tf-sticky-yes'), 895 section_height = $(class_section).outerHeight(), 896 section_width = $(class_section).outerWidth(), 897 injectSpace = $('<div />', { height: section_height }).insertAfter($(class_section)); 898 injectSpace.hide(); 899 900 var element_class_sticky = '.elementor-element-'+section_id, 901 tfsticky = $(element_class_sticky+'.tf-sticky-yes'), 902 offset = tfsticky.offset(), 903 tfsticky_offset_top = offset.top; 904 $(element_class_sticky+'.elementor-inner-section.tf-sticky-yes').css({'width':section_width}); 905 if ($('body').hasClass('admin-bar')) { 906 var tfsticky_offset_top = tfsticky_offset_top - wpadminbar; 907 } 908 $(window).on('scroll', function() { 909 if ( $(window).scrollTop() >= tfsticky_offset_top ) { 910 tfsticky.addClass('tf-element-sticky'); 911 injectSpace.show(); 912 } else { 913 tfsticky.removeClass('tf-element-sticky'); 914 injectSpace.hide(); 915 } 916 }); 917 } 918 }) 919 } 920 921 /* Go top 922 ------------------------------------*/ 923 var tfScrollTop = function() { 924 $(window).scroll(function() { 925 if ( $(this).scrollTop() > 200 ) { 926 $('#tf-scroll-top').addClass('show'); 927 } else { 928 $('#tf-scroll-top').removeClass('show'); 929 } 930 }); 931 932 $('#tf-scroll-top .inner-scroll-top').on('click', function() { 933 $('html, body').animate({ scrollTop: 0 }, 1000 , 'easeInOutExpo'); 934 return false; 935 }); 936 } 937 938 /* Preloader 939 ------------------------------------*/ 940 var tfRemovePreloader = function() { 941 setTimeout(function() { 942 $(".tf-preloader").fadeOut('slow',function(){ 943 $(this).remove(); 944 }); 945 }, 1000); 946 }; 947 948 var tfPortfolioCube = function() { 949 if ( $().cubeportfolio ) { 950 $('.themesflat_sc_vc-portfolios-grid').each(function() { 951 var 952 $this = $(this), 953 item = $this.data("column"), 954 item2 = $this.data("column2"), 955 item3 = $this.data("column3"), 956 item4 = $this.data("column4"), 957 gapH = Number($this.data("gaph")), 958 gapV = Number($this.data("gapv")), 959 filter = $this.data("filter"); 960 961 if ( !filter ) { filter = '*'; } 962 else { filter = '.' + filter; } 963 964 $(this).find('#tfportfolio').cubeportfolio({ 965 filters: '#portfolios-filter', 966 layoutMode: 'grid', 967 defaultFilter: filter, 968 animationType: 'flipOutDelay', 969 gapHorizontal: gapH, 970 gapVertical: gapV, 971 showNavigation: true, 972 showPagination: true, 973 gridAdjustment: 'responsive', 974 rewindNav: false, 975 auto: false, 976 mediaQueries: [{ 977 width: 1500, 978 cols: item 979 }, { 980 width: 1100, 981 cols: item 982 }, { 983 width: 800, 984 cols: item2 985 }, { 986 width: 550, 987 cols: item3 988 }, { 989 width: 320, 990 cols: item4 991 }], 992 caption: 'overlayBottomAlong',
993 displayType: 'bottomToTop', 994 displayTypeSpeed: 100 995 }); 996 }); 997 } 998 }; 999 1000 var tfGalleryCube = function() { 1001 if ( $().cubeportfolio ) { 1002 $('.themesflat_sc_vc-gallery').each(function() { 1003 var 1004 $this = $(this), 1005 item = $this.data("column"), 1006 item2 = $this.data("column2"), 1007 item3 = $this.data("column3"), 1008 item4 = $this.data("column4"), 1009 gapH = Number($this.data("gaph")), 1010 gapV = Number($this.data("gapv")); 1011 1012 $(this).find('#tfgallery').cubeportfolio({ 1013 layoutMode: 'grid', 1014 animationType: 'flipOutDelay', 1015 gapHorizontal: gapH, 1016 gapVertical: gapV, 1017 showNavigation: true, 1018 showPagination: true, 1019 gridAdjustment: 'responsive', 1020 rewindNav: false, 1021 auto: false, 1022 mediaQueries: [{ 1023 width: 1500, 1024 cols: item 1025 }, { 1026 width: 1100, 1027 cols: item 1028 }, { 1029 width: 800, 1030 cols: item2 1031 }, { 1032 width: 550, 1033 cols: item3 1034 }, { 1035 width: 320, 1036 cols: item4 1037 }], 1038 caption: 'overlayBottomAlong', 1039 displayType: 'bottomToTop', 1040 displayTypeSpeed: 100 1041 }); 1042 }); 1043 } 1044 }; 1045 1046 var tfGalleryJustified = function() { 1047 if ($('.justified_gallery').length > 0) { 1048 $(".justified_gallery").justifiedGallery(); 1049 var $justifiedgallery = $('.justified_gallery'); 1050 $justifiedgallery.each(function () { 1051 var $element = $(this), 1052 rowHeight = $element.attr('data-rowHeight') || "200", 1053 margins = $element.attr('data-margins') || "10" 1054 $element.appear(function () { 1055 $element.justifiedGallery({ 1056 rowHeight: Number(rowHeight), 1057 margins: Number(margins), 1058 }); 1059 }); 1060 }); 1061 }; 1062 } 1063 1064 $(window).on('elementor/frontend/init', function() { 1065 elementorFrontend.hooks.addAction( 'frontend/element_ready/tf-nav-menu.default', responsive_menu ); 1066 elementorFrontend.hooks.addAction( 'frontend/element_ready/tfcarousel.default', carousel_Box ); 1067 elementorFrontend.hooks.addAction( 'frontend/element_ready/tf-nav-menu.default', onepage_nav ); 1068 elementorFrontend.hooks.addAction( 'frontend/element_ready/tf-search.default', search_form ); 1069 elementorFrontend.hooks.addAction( 'frontend/element_ready/tfposts.default', blogPostsOwl ); 1070 elementorFrontend.hooks.addAction( 'frontend/element_ready/tfposts.default', blogPostsGallery ); 1071 elementorFrontend.hooks.addAction( 'frontend/element_ready/tfposts.default', blogLoadMore ); 1072 elementorFrontend.hooks.addAction( 'frontend/element_ready/tfposts.default', blogMasonry ); 1073 elementorFrontend.hooks.addAction( 'frontend/element_ready/tfposts.default', customizable_carousel ); 1074 elementorFrontend.hooks.addAction( 'frontend/element_ready/tfposts.default', postFormatIziModal ); 1075 elementorFrontend.hooks.addAction( 'frontend/element_ready/tftabs.default', tftabs ); 1076 elementorFrontend.hooks.addAction( 'frontend/element_ready/vegas-slider.default', vegasSlider ); 1077 elementorFrontend.hooks.addAction( 'frontend/element_ready/flex-slider.default', flexSlider ); 1078 elementorFrontend.hooks.addAction( 'frontend/element_ready/tf-scroll-top.default', tfScrollTop ); 1079 elementorFrontend.hooks.addAction( 'frontend/element_ready/tf-preload.default', tfRemovePreloader ); 1080 1081 elementorFrontend.hooks.addAction( 'frontend/element_ready/tfwooproductgrid.default', productCarousel ); 1082 elementorFrontend.hooks.addAction( 'frontend/element_ready/tfwooproductgrid.default', productLoadMore ); 1083 elementorFrontend.hooks.addAction( 'frontend/element_ready/tfwooproductgrid.default', productFilterForm ); 1084 elementorFrontend.hooks.addAction( 'frontend/element_ready/tfwooproductgrid.default', productFilterTabs ); 1085 elementorFrontend.hooks.addAction( 'frontend/element_ready/tfwooproductsingleimage.default', productSingleImage ); 1086 elementorFrontend.hooks.addAction( 'frontend/element_ready/tf-mini-cart.default', cavas_product_mini_cart ); 1087 1088 elementorFrontend.hooks.addAction( 'frontend/element_ready/tfportfolio.default', tfPortfolioCube ); 1089 elementorFrontend.hooks.addAction( 'frontend/element_ready/tfgallery.default', tfGalleryCube ); 1090 elementorFrontend.hooks.addAction( 'frontend/element_ready/tfgallery.default', tfGalleryJustified ); 1091 });
1092 1093 $(window).on('load resize', function() { 1094 responsive_menu(); 1095 onepage_nav(); 1096 search_form(); 1097 }); 1098 1099 // Dom Ready 1100 $(function() { 1101 flexSlider(); 1102 vegasSlider(); 1103 postFormatIziModal(); 1104 TF_Sticky(); 1105 }); 1106 1107 $(window).on('resize', function() { 1108 flexSlider(); 1109 vegasSlider(); 1110 }); 1111 1112 $(window).on('load', function() { 1113 cavas_product_mini_cart(); 1114 }); 1115 1116})(jQuery);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.