1jQuery(function($){ 2 "use strict"; 3 4 ts_register_carousel( null, $ ); 5 6 /* Elementor Lazy Load */ 7 if( $('.ts-elementor-lazy-load').length ){ 8 var ts_elementor_lazy_load_loaded_widget = []; /* prevent double load same widget */ 9 $(window).on('scroll ts_elementor_lazy_load', function(){ 10 var scroll_top = $(this).scrollTop(); 11 var window_height = $(this).height(); 12 var number_request = 0; 13 $('.ts-elementor-lazy-load:not(.loaded)').each(function(i, e){ 14 if( $(e).offset().top > scroll_top + window_height + 600 ){ 15 return false; 16 } 17 var timeout = number_request * 200 + 10; /* dont show many requests same time */ 18 number_request++; 19 var el = $(e); 20 var widget_id = el.closest('.elementor-element[data-id]').attr('data-id'); 21 var widget = $('.elementor-element[data-id="' + widget_id + '"]'); /* may added many */ 22 widget.find('.ts-elementor-lazy-load').addClass('loaded'); 23 var post_id = el.parents('[data-elementor-id]').attr('data-elementor-id'); 24 25 setTimeout(function(){ 26 if( ts_elementor_lazy_load_loaded_widget.includes( widget_id ) ){ 27 return; 28 } 29 ts_elementor_lazy_load_loaded_widget.push( widget_id ); 30 31 $.ajax({ 32 type : "POST", 33 timeout : 30000, 34 url : themesky_params.ajax_uri, 35 data : {action: 'ts_elementor_lazy_load', widget_id: widget_id, post_id: post_id}, 36 error: function(xhr,err){ 37 38 }, 39 success: function( response ){ 40 if( response ){ 41 widget.replaceWith( response.data ); 42 43 /* Generate slider */ 44 _ts_generate_slider_timeout = false; 45 ts_register_carousel( null, $ ); 46 47 widget = $('.elementor-element[data-id="' + widget_id + '"]'); /* new widget */ 48 /* Countdown */ 49 if( widget.find('.counter-wrapper').length ){ 50 ts_counter( widget.find('.counter-wrapper') ); 51 } 52 53 /* Blog Masonry */ 54 if( widget.find('.ts-blogs-wrapper.ts-masonry').length ){ 55 ts_register_masonry( null, $ ); 56 } 57 58 /* Tabs shop more button */ 59 var el_tabs = widget.find('.ts-product-in-category-tab-wrapper'); 60 if( el_tabs.length ){ 61 ts_product_in_category_tab_shop_more_handle( el_tabs, el_tabs.data('atts') ); 62 } 63 64 /* Product name min height */ 65 $(window).trigger('ts_product_name_min_height'); 66 67 $(window).trigger('ts_elementor_lazy_load_loaded', [widget_id]); 68 } 69 } 70 }); 71 }, timeout); 72 }); 73 }); 74 75 if( $('#main .ts-elementor-lazy-load').length && $('#main .ts-elementor-lazy-load:first').offset().top < $(window).scrollTop() + $(window).height() ){ 76 $(window).trigger('ts_elementor_lazy_load'); 77 } 78 79 if( $('.menu-item.ts-megamenu .ts-elementor-lazy-load').length ){ 80 $('.menu-item.ts-megamenu').on('mouseenter', function(){ 81 $(window).trigger('ts_elementor_lazy_load'); 82 }); 83 } 84 } 85 86 /*** Load Products In Category Tab ***/ 87 var ts_product_in_category_tab_data = []; 88 89 /* Change tab */ 90 $(document).on('click', '.ts-product-in-category-tab-wrapper .column-tabs .tab-item, .ts-product-in-product-type-tab-wrapper .column-tabs .tab-item', function(){ 91 var element = $(this).parents('.ts-product-in-category-tab-wrapper'); 92 var is_product_type_tab = false; 93 if( element.length == 0 ){ 94 element = $(this).parents('.ts-product-in-product-type-tab-wrapper'); 95 is_product_type_tab = true; 96 } 97 98 var element_top = element.offset().top; 99 if( element_top > $(window).scrollTop() ){ 100 var admin_bar_height = $('#wpadminbar').length > 0?$('#wpadminbar').outerHeight():0; 101 var sticky_height = $('.is-sticky .header-sticky').length > 0?$('.is-sticky .header-sticky').outerHeight():0; 102 $('body, html').animate({ 103 scrollTop: element_top - sticky_height - admin_bar_height - 20 104 }, 500); 105 } 106 107 if( $(this).hasClass('current') || element.find('.column-products').hasClass('loading') ){ 108 return; 109 } 110 111 element.removeClass('generated-slider'); 112 113 var element_id = element.attr('id'); 114 var atts = element.data('atts'); 115 if( !is_product_type_tab ){ 116 var product_cat = $(this).data('product_cat'); 117 var shop_more_link = $(this).data('link'); 118 var is_general_tab = $(this).hasClass('general-tab')?1:0; 119 } 120 else{ 121 if( element.find('.list-categories .cat-item.current').length ){ 122 var product_cat = element.find('.list-categories .cat-item.current').data('product_cat'); 123 } 124 else{ 125 var product_cat = atts.product_cats; 126 } 127 var is_general_tab = 0; 128 atts.product_type = $(this).data('product_type'); 129 element.find('.column-products').removeClass('recent sale featured best_selling top_rated mixed_order').addClass(atts.product_type); 130 } 131 132 if( !is_product_type_tab && element.find('a.shop-more-button').length > 0 ){ 133 element.find('a.shop-more-button').attr('href', shop_more_link); 134 } 135 136 element.find('.column-tabs .tab-item').removeClass('current'); 137 $(this).addClass('current'); 138 139 /* Check cache */ 140 var tab_data_index = element_id + '-' + product_cat.toString().split(',').join('-'); 141 if( is_product_type_tab ){ 142 tab_data_index += '-' + atts.product_type; 143 } 144 if( ts_product_in_category_tab_data[tab_data_index] != undefined ){ 145 element.find('.column-products .products').remove(); 146 element.find('.column-products').append( ts_product_in_category_tab_data[tab_data_index] ).hide().fadeIn(600); 147 148 /* Shop more button handle */ 149 if( !is_product_type_tab ){ 150 ts_product_in_category_tab_shop_more_handle( element, atts ); 151 } 152 153 /* Generate slider */ 154 _ts_generate_slider_timeout = false;
155 ts_register_carousel( element.parent(), $ ); 156 157 $(window).trigger('ts_product_name_min_height'); 158 159 return; 160 } 161 162 element.find('.column-products').addClass('loading'); 163 164 $.ajax({ 165 type : "POST", 166 timeout : 30000, 167 url : themesky_params.ajax_uri, 168 data : {action: 'ts_get_product_content_in_category_tab', atts: atts, product_cat: product_cat, is_general_tab: is_general_tab}, 169 error: function(xhr,err){ 170 171 }, 172 success: function(response) { 173 if( response ){ 174 element.find('.column-products .products').remove(); 175 element.find('.column-products').append( response ).hide().fadeIn(600); 176 177 /* save cache */ 178 if( element.find('.counter-wrapper').length == 0 ){ 179 ts_product_in_category_tab_data[tab_data_index] = response; 180 } 181 else{ 182 ts_counter( element.find('.counter-wrapper') ); 183 } 184 /* Shop more button handle */ 185 if( !is_product_type_tab ){ 186 ts_product_in_category_tab_shop_more_handle( element, atts ); 187 } 188 /* Generate slider */ 189 _ts_generate_slider_timeout = false; 190 ts_register_carousel( element.parent(), $ ); 191 192 $(window).trigger('ts_product_name_min_height'); 193 } 194 element.find('.column-products').removeClass('loading'); 195 } 196 }); 197 }); 198 199 $(document).on('click', '.ts-product-in-product-type-tab-wrapper .list-categories .cat-item', function(){ 200 if( $(this).hasClass('current') ){ 201 return; 202 } 203 204 $(this).siblings().removeClass('current'); 205 $(this).addClass('current'); 206 207 var wrapper = $(this).parents('.ts-product-in-product-type-tab-wrapper'); 208 wrapper.find('.column-tabs .tab-item.current').removeClass('current').trigger('click'); 209 }); 210 211 function ts_product_in_category_tab_shop_more_handle(element, atts){ 212 var hide_shop_more = element.find('.hide-shop-more').length; 213 element.find('.hide-shop-more').remove(); 214 215 if( element.find('.tab-item.current').hasClass('general-tab') && atts.show_shop_more_general_tab == 0 ){ 216 hide_shop_more = true; 217 } 218 219 if( element.find('.products .product').length == 0 ){ 220 hide_shop_more = true; 221 } 222 223 if( atts.show_shop_more_button == 1 ){ 224 if( hide_shop_more ){ 225 element.find('.shop-more').addClass('hidden'); 226 element.removeClass('has-shop-more-button'); 227 } 228 else{ 229 element.find('.shop-more').removeClass('hidden'); 230 element.addClass('has-shop-more-button'); 231 } 232 } 233 } 234 235 $('.ts-product-in-category-tab-wrapper').each(function(){ 236 var element = $(this); 237 var atts = element.data('atts'); 238 ts_product_in_category_tab_shop_more_handle( element, atts ); 239 }); 240 241 /*** List of Product Categories ***/ 242 $('.ts-list-of-product-categories-wrapper .nav-button').on('click', function(){ 243 var scroll_wrap = $(this).parents('.list-categories'); 244 var action = $(this).data('action'); 245 var scroll_left = scroll_wrap.get(0).scrollLeft; 246 scroll_left += action == 'prev' ? -150 : 150; 247 scroll_wrap.animate({ 248 scrollLeft: scroll_left 249 }, 200); 250 }); 251 252 $('.ts-list-of-product-categories-wrapper.style-horizontal').each(function(){ 253 var scroll_wrap = $(this).find('.list-categories'); 254 if( scroll_wrap.get(0).scrollWidth > scroll_wrap.width() ){ 255 scroll_wrap.find('.nav-button').show(); 256 } 257 }); 258 259 /*** Blog Shortcode ***/ 260 $(document).on('click', '.ts-blogs-wrapper a.load-more', function(){ 261 var element = $(this).parents('.ts-blogs-wrapper'); 262 var atts = element.data('atts'); 263 var is_masonry = typeof $.fn.isotope == 'function' && element.hasClass('ts-masonry') ? true : false; 264 265 var button = $(this); 266 if( button.hasClass('loading') ){ 267 return false; 268 } 269 270 button.addClass('loading'); 271 var paged = button.attr('data-paged'); 272 var total_pages = button.attr('data-total_pages'); 273 274 $.ajax({ 275 type : "POST", 276 timeout : 30000, 277 url : themesky_params.ajax_uri, 278 data : {action: 'ts_blogs_load_items', paged: paged, atts : atts}, 279 error: function(xhr,err){ 280 281 }, 282 success: function(response) { 283 if( paged == total_pages ){ 284 button.parent().remove(); 285 } 286 else{ 287 button.removeClass('loading'); 288 button.attr('data-paged', ++paged); 289 } 290 if( response != 0 && response != '' ){ 291 if( is_masonry ){ 292 element.find('.blogs').isotope('insert', $(response)); 293 setTimeout(function(){ 294 element.find('.blogs').isotope('layout'); 295 }, 500); 296 } 297 else{ 298 element.find('.blogs').append(response); 299 } 300 301 ts_register_carousel( element.parent(), $ ); 302 } 303 else{ /* No results */ 304 button.parent().remove(); 305 } 306 } 307 }); 308 309 return false;
310 }); 311 312 /*** Reload SoundCloud ***/ 313 setTimeout(function(){ 314 $('.owl-item .ts-soundcloud iframe').each(function(){ 315 var iframe = $(this); 316 var src = iframe.attr('src'); 317 iframe.attr('src', src); 318 }); 319 }, 200); 320 321 /*** Counter ***/ 322 ts_counter( $('.product .counter-wrapper, .ts-countdown .counter-wrapper') ); 323 324 /*** Portfolio ***/ 325 $('.ts-portfolio-wrapper .load-more').on('click', function(){ 326 var element = $(this).parents('.ts-portfolio-wrapper'); 327 var atts = element.data('atts'); 328 var button = $(this); 329 if( button.hasClass('loading') ){ 330 return false; 331 } 332 333 button.addClass('loading'); 334 var paged = button.attr('data-paged'); 335 var total_pages = button.attr('data-total_pages'); 336 337 $.ajax({ 338 type : "POST", 339 timeout : 30000, 340 url : themesky_params.ajax_uri, 341 data : {action: 'ts_portfolio_load_items', paged: paged, atts : atts}, 342 error: function(xhr,err){ 343 344 }, 345 success: function(response) { 346 if( paged == total_pages ){ 347 button.parent().remove(); 348 } 349 else{ 350 button.removeClass('loading'); 351 button.attr('data-paged', ++paged); 352 } 353 if( response != 0 && response != '' ){ 354 if( typeof $.fn.isotope == 'function' ){ 355 element.find('.portfolio-inner').isotope('insert', $(response)); 356 element.find('.filter-bar li.current').trigger('click'); 357 setTimeout(function(){ 358 element.find('.portfolio-inner').isotope('layout'); 359 }, 500); 360 } 361 } 362 else{ /* No results */ 363 button.parent().remove(); 364 } 365 } 366 }); 367 368 return false; 369 }); 370 371 $('.ts-portfolio-wrapper .filter-bar li').on('click', function(){ 372 $(this).siblings('li').removeClass('current'); 373 $(this).addClass('current'); 374 var container = $(this).parents('.ts-portfolio-wrapper').find('.portfolio-inner'); 375 var data_filter = $(this).data('filter'); 376 container.isotope({filter: data_filter}); 377 }); 378 379 /* Update like */ 380 $(document).on('click', '.ts-portfolio-wrapper .portfolio-meta .like, .single-portfolio .portfolio-like .ic-like', function(e){ 381 var _this = $(this); 382 383 if( _this.hasClass('loading') ){ 384 return false; 385 } 386 _this.addClass('loading'); 387 388 var already_like = _this.hasClass('already-like'); 389 var is_single = _this.hasClass('ic-like'); 390 391 var post_id = _this.data('post_id'); 392 $.ajax({ 393 type : "POST", 394 timeout : 30000, 395 url : themesky_params.ajax_uri, 396 data : {action: 'ts_portfolio_update_like', post_id: post_id}, 397 error: function(xhr,err){ 398 _this.removeClass('loading'); 399 }, 400 success: function(response) { 401 if( response != '' ){ 402 if( already_like ){ 403 _this.removeClass('already-like'); 404 if( !is_single ){ 405 _this.attr('title', _this.data('like-title')); 406 } 407 } 408 else{ 409 _this.addClass('already-like'); 410 if( !is_single ){ 411 _this.attr('title', _this.data('liked-title')); 412 } 413 } 414 if( is_single ){ 415 var single_plural = '1' == response ? 'single' : 'plural'; 416 response += ' ' + _this.siblings('.like-num').data(single_plural); 417 _this.siblings('.like-num').text(response); 418 } 419 } 420 _this.removeClass('loading'); 421 } 422 }); 423 424 return false; 425 }); 426 427 /*** Widgets ***/ 428 /* Custom WP Widget Categories Dropdown */ 429 $('.widget_categories > ul').each(function(index, ele){ 430 var _this = $(ele); 431 var icon_toggle_html = '<span class="icon-toggle"></span>'; 432 var ul_child = _this.find('ul.children'); 433 ul_child.hide(); 434 ul_child.closest('li').addClass('cat-parent'); 435 ul_child.before( icon_toggle_html ); 436 }); 437 438 $('.widget_categories span.icon-toggle').on('click', function(){ 439 var parent_li = $(this).parent('li.cat-parent'); 440 if( !parent_li.hasClass('active') ){ 441 parent_li.find('ul.children:first').slideDown(); 442 parent_li.addClass('active'); 443 } 444 else{ 445 parent_li.find('ul.children').slideUp(); 446 parent_li.removeClass('active'); 447 parent_li.find('li.cat-parent').removeClass('active'); 448 } 449 }); 450 451 $('.widget_categories li.current-cat').parents('ul.children').siblings('.icon-toggle').trigger('click'); 452 $('.widget_categories li.current-cat.cat-parent > .icon-toggle').trigger('click'); 453 454 /* Product Categories widget */ 455 $('.ts-product-categories-widget .icon-toggle').on('click', function(){ 456 var parent_li = $(this).parent('li.cat-parent'); 457 if( !parent_li.hasClass('active') ){ 458 parent_li.addClass('active'); 459 parent_li.find('ul.children:first').slideDown(); 460 } 461 else{
462 parent_li.find('ul.children').slideUp(); 463 parent_li.removeClass('active'); 464 parent_li.find('li.cat-parent').removeClass('active'); 465 } 466 }); 467 468 $('.ts-product-categories-widget').each(function(){ 469 var element = $(this); 470 element.find('ul.children').parent('li').addClass('cat-parent'); 471 element.find('li.current.cat-parent > .icon-toggle').trigger('click'); 472 element.find('li.current').parents('ul.children').siblings('.icon-toggle').trigger('click'); 473 }); 474 475 $('.ts-product-categories-widget .all-categories > span').on('click', function(){ 476 $(this).toggleClass('active'); 477 $(this).siblings().slideToggle(); 478 }); 479 480 /* Product Filter By Availability */ 481 $('.product-filter-by-availability-wrapper > ul input[type="checkbox"]').on('change', function(){ 482 $(this).parent('li').siblings('li').find('input[type="checkbox"]').attr('checked', false); 483 var val = ''; 484 if( $(this).is(':checked') ){ 485 val = $(this).val(); 486 } 487 var form = $(this).closest('ul').siblings('form'); 488 if( val != '' ){ 489 form.find('input[name="stock"]').val(val); 490 } 491 else{ 492 form.find('input[name="stock"]').remove(); 493 } 494 form.submit(); 495 }); 496 497 /* Product Filter By Brand */ 498 $('.product-filter-by-brand-wrapper ul input[type="checkbox"]').on('change', function(){ 499 var wrapper = $(this).parents('.product-filter-by-brand-wrapper'); 500 var query_type = wrapper.find('> .query-type').val(); 501 var checked = $(this).is(':checked'); 502 var val = new Array(); 503 if( query_type == 'or' ){ 504 wrapper.find('ul input[type="checkbox"]').attr('checked', false); 505 if( checked ){ 506 $(this).off('change'); 507 $(this).attr('checked', true); 508 val.push( $(this).val() ); 509 } 510 } 511 else{ 512 wrapper.find('ul input[type="checkbox"]:checked').each(function(index, ele){ 513 val.push( $(ele).val() ); 514 }); 515 } 516 val = val.join(','); 517 var form = wrapper.find('form'); 518 if( val != '' ){ 519 form.find('input[name="product_brand"]').val( val ); 520 } 521 else{ 522 form.find('input[name="product_brand"]').remove(); 523 } 524 form.submit(); 525 }); 526}); 527 528function zeroise( str, max ){ 529 str = str.toString(); 530 return str.length < max ? zeroise('0' + str, max) : str; 531} 532 533function ts_counter( elements ){ 534 if( elements.length ){ 535 var interval = setInterval(function(){ 536 elements.each(function(index, element){ 537 var wrapper = jQuery(element); 538 var second = parseInt( wrapper.find('.seconds .number').text() ); 539 if( second > 0 ){ 540 second--; 541 second = ( second < 10 )? zeroise(second, 2) : second.toString(); 542 wrapper.find('.seconds .number').text(second); 543 return; 544 } 545 546 var delta = 0; 547 var time_day = 60 * 60 * 24; 548 var time_hour = 60 * 60; 549 var time_minute = 60; 550 551 var day = parseInt( wrapper.find('.days .number').text() ); 552 var hour = parseInt( wrapper.find('.hours .number').text() ); 553 var minute = parseInt( wrapper.find('.minutes .number').text() ); 554 555 if( day != 0 || hour != 0 || minute != 0 || second != 0 ){ 556 delta = (day * time_day) + (hour * time_hour) + (minute * time_minute) + second; 557 delta--; 558 559 day = Math.floor(delta / time_day); 560 delta -= day * time_day; 561 562 hour = Math.floor(delta / time_hour); 563 delta -= hour * time_hour; 564 565 minute = Math.floor(delta / time_minute); 566 delta -= minute * time_minute; 567 568 second = delta > 0?delta:0; 569 570 day = ( day < 10 )? zeroise(day, 2) : day.toString(); 571 hour = ( hour < 10 )? zeroise(hour, 2) : hour.toString(); 572 minute = ( minute < 10 )? zeroise(minute, 2) : minute.toString(); 573 second = ( second < 10 )? zeroise(second, 2) : second.toString(); 574 575 wrapper.find('.days .number').text(day); 576 wrapper.find('.hours .number').text(hour); 577 wrapper.find('.minutes .number').text(minute); 578 wrapper.find('.seconds .number').text(second); 579 } 580 581 }); 582 }, 1000); 583 } 584} 585 586class TS_Carousel{ 587 register( $scope, $ ){ 588 var carousel = this; 589 590 /* [wrapper selector, slider selector, slider options (remove dynamic columns at last)] */ 591 var data = [ 592 ['.ts-product-wrapper', '.products', { responsive:{0:{items:1},320:{items:2},510:{items:3},690:{items:4}} }] 593 ,['.ts-product-deals-wrapper', '.products', { responsive:{0:{items:1},320:{items:2},610:{items:3},810:{items:4}} }] 594 ,['.ts-product-category-wrapper', '.products', { responsive:{0:{items:1},440:{items:2},510:{items:3},690:{items:4}} }] 595 ,['.ts-product-brand-wrapper', '.content-wrapper', { responsive:{0:{items:1},300:{items:2},690:{items:3}} }] 596 ,['.ts-products-widget-wrapper', null, { margin: 10, responsive:{0:{items:1}} }] 597 ,['.ts-blogs-wrapper', '.content-wrapper > .blogs', { responsive:{0:{items:1},570:{items:2},690:{items:3}} }] 598 ,['.ts-logo-slider-wrapper', '.items', { responsive:{0:{items:1},300:{items:2},400:{items:3},640:{items:4},810:{items:5}} }] 599 ,['.ts-team-members', '.items', { responsive:{0:{items:1},350:{items:2},690:{items:3}} }] 600 ,['.ts-instagram-wrapper', '.items', { margin: 10, responsive: {0:{items:1},320:{items:2},500:{items:3},690:{items:4}} }]
601 ,['.ts-portfolio-wrapper', '.portfolio-inner', { responsive: {0:{items:1},500:{items:2},810:{items:3}} }] 602 ,['.ts-blogs-widget-wrapper', null, { margin: 10, responsive: {0:{items:1}} }] 603 ,['.ts-recent-comments-widget-wrapper', null, { margin: 10, responsive: {0:{items:1}} }] 604 ,['.ts-product-in-category-tab-wrapper, .ts-product-in-product-type-tab-wrapper', '.products', { responsive:{0:{items:1},320:{items:2},510:{items:3},690:{items:4}} }] 605 ,['.ts-blogs-wrapper .thumbnail.gallery', 'figure', { nav: true, animateIn: 'fadeIn', animateOut: 'fadeOut', margin: 10, mouseDrag: false, touchDrag: false, responsive:{0:{items:1}} }] 606 ]; 607 608 $.each(data, function(index, value){ 609 carousel.run( value, $ ); 610 }); 611 } 612 613 run( data, $ ){ 614 $(data[0]).each(function(){ 615 if( ! $(this).hasClass('ts-slider') || $(this).hasClass('generated-slider') ){ 616 return; 617 } 618 $(this).addClass('generated-slider'); 619 620 var element = $(this); 621 var show_nav = typeof element.attr('data-nav') != 'undefined' && element.attr('data-nav') == 1?true:false; 622 var show_dots = typeof element.attr('data-dots') != 'undefined' && element.attr('data-dots') == 1?true:false; 623 var auto_play = typeof element.attr('data-autoplay') != 'undefined' && element.attr('data-autoplay') == 1?true:false; 624 var columns = typeof element.attr('data-columns') != 'undefined'?parseInt(element.attr('data-columns')):5; 625 var disable_responsive = typeof element.attr('data-disable_responsive') != 'undefined' && element.attr('data-disable_responsive') == 1?true:false; 626 var prev_nav_text = typeof element.attr('data-prev_nav_text') != 'undefined'?element.attr('data-prev_nav_text'):''; 627 var next_nav_text = typeof element.attr('data-next_nav_text') != 'undefined'?element.attr('data-next_nav_text'):''; 628 var responsive_base = typeof data[1] != 'undefined' && data[1] != null ? element.find(data[1]) : element; 629 630 var slider_options = { 631 loop: true 632 ,nav: show_nav 633 ,navText: [prev_nav_text, next_nav_text] 634 ,dots: show_dots 635 ,navSpeed: 1000 636 ,rtl: $('body').hasClass('rtl') 637 ,margin: 0 638 ,navRewind: false 639 ,autoplay: auto_play 640 ,autoplayHoverPause: true 641 ,autoplaySpeed: 1000 642 ,responsiveBaseElement: responsive_base 643 ,responsiveRefreshRate: 400 644 ,responsive:{0:{items:1},320:{items:2},580:{items:3},810:{items:columns}} 645 ,onInitialized: function(){ 646 element.removeClass('loading'); 647 element.find('.loading').removeClass('loading'); 648 } 649 }; 650 651 if( typeof data[2] != 'undefined' && data[2] != null ){ 652 $.extend( slider_options, data[2] ); 653 654 if( typeof data[2].responsive != 'undefined' ){ /* change responsive => add dynamic columns at last */ 655 switch( data[0] ){ 656 case '.ts-product-deals-wrapper': 657 case '.ts-blogs-wrapper': 658 case '.ts-product-wrapper': 659 if( element.hasClass('show-counter') ){ 660 slider_options.responsive = {0:{items:1},500:{items:2},690:{items:3}}; 661 } 662 slider_options.responsive[810] = {items:columns}; 663 if( element.hasClass('item-layout-list') ){ 664 slider_options.responsive = {0:{items:1},320:{items:2},1200:{items:columns}}; 665 } 666 break; 667 case '.ts-product-category-wrapper': 668 case '.ts-product-brand-wrapper': 669 slider_options.responsive[810] = {items:columns}; 670 break; 671 case '.ts-team-members': 672 slider_options.responsive[810] = {items:columns}; 673 break; 674 case '.ts-instagram-wrapper': 675 case '.ts-portfolio-wrapper': 676 slider_options.responsive[1170] = {items:columns}; 677 break; 678 case '.ts-product-in-category-tab-wrapper, .ts-product-in-product-type-tab-wrapper': 679 slider_options.responsive[810] = {items:columns}; 680 break; 681 default: 682 } 683 } 684 } 685 686 if( element.hasClass('use-logo-setting') ){ /* Product Brands - Logos */ 687 var break_point = element.data('break_point'); 688 var item = element.data('item'); 689 if( break_point.length > 0 ){ 690 slider_options.responsive = {}; 691 for( var i = 0; i < break_point.length; i++ ){ 692 slider_options.responsive[break_point[i]] = {items: item[i]}; 693 } 694 } 695 } 696 697 if( disable_responsive ){ 698 slider_options.responsive = {0:{items:columns}}; 699 } 700 701 if( columns == 1 ){ 702 slider_options.responsive = {0:{items:1},320:{items:2},700:{items:3}}; 703 } 704 705 if( typeof data[1] != 'undefined' && data[1] != null ){ 706 element.find(data[1]).owlCarousel( slider_options ); 707 } 708 else{ 709 element.owlCarousel( slider_options ); 710 } 711 }); 712 } 713} 714 715var _ts_generate_slider_timeout = true; 716function ts_register_carousel( $scope, $ ){ 717 var carousel = new TS_Carousel(); 718 if( _ts_generate_slider_timeout ){ 719 setTimeout(function(){ 720 carousel.register( $scope, $ ); 721 }, 100); 722 } 723 else{ 724 carousel.register( $scope, $ ); 725 } 726} 727 728function ts_register_masonry( $scope, $ ){ 729 if( typeof $.fn.isotope == 'function' ){ 730 /* Blog */ 731 $('.ts-blogs-wrapper.ts-masonry .blogs').isotope(); 732 $('.ts-blogs-wrapper.ts-masonry').removeClass('loading'); 733 734 /* Portfolio */ 735 $('.ts-portfolio-wrapper.ts-masonry .portfolio-inner').isotope({filter: '*'}); 736 $('.ts-portfolio-wrapper.ts-masonry').removeClass('loading'); 737 } 738} 739 740jQuery(window).on('elementor/frontend/init', function(){ 741 var elements = ['ts-products', 'ts-product-deals', 'ts-product-categories', 'ts-product-brands', 'ts-blogs'
742 ,'ts-logos', 'ts-team-members', 'ts-testimonial', 'ts-portfolios' 743 ,'ts-products-in-category-tabs', 'ts-products-in-product-type-tabs' 744 ,'wp-widget-ts_products', 'wp-widget-ts_blogs', 'wp-widget-ts_recent_comments', 'wp-widget-ts_instagram']; 745 jQuery.each(elements, function(index, name){ 746 elementorFrontend.hooks.addAction( 'frontend/element_ready/' + name + '.default', ts_register_carousel ); 747 }); 748 749 elements = ['ts-blogs', 'ts-portfolios']; 750 jQuery.each(elements, function(index, name){ 751 elementorFrontend.hooks.addAction( 'frontend/element_ready/' + name + '.default', ts_register_masonry ); 752 }); 753});
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.