1 2var page_reload = false; 3 4if (typeof woocommerce_params !== 'undefined' && typeof woocommerce_params.ajax_loader_url == 'undefined') 5 woocommerce_params.ajax_loader_url = js_venedor_vars.ajax_loader_url; 6 7(function ($) { 8 "use strict"; 9 10 // check mobile 11 var venedorIsMobile = { 12 Android: function() { 13 return navigator.userAgent.match(/Android/i); 14 }, 15 BlackBerry: function() { 16 return navigator.userAgent.match(/BlackBerry/i); 17 }, 18 iOS: function() { 19 return navigator.userAgent.match(/iPhone|iPad|iPod/i); 20 }, 21 Opera: function() { 22 return navigator.userAgent.match(/Opera Mini/i); 23 }, 24 Windows: function() { 25 return navigator.userAgent.match(/IEMobile/i); 26 }, 27 any: function() { 28 return (venedorIsMobile.Android() || venedorIsMobile.BlackBerry() || venedorIsMobile.iOS() || venedorIsMobile.Opera() || venedorIsMobile.Windows()); 29 } 30 }; 31 32 if (navigator.userAgent.search("Safari") >
32= 0 && navigator.userAgent.search("Chrome") < 0) { 33 $('body').addClass('safari'); 34 } 35 36 var menu_container_width = 0; 37 38 function initMegaMenu() { 39 40 var megamenu_len = $('.mega-menu').length; 41 var i = 0; 42 43 $('.mega-menu').each( function() { 44 var $menu_container = $(this).parent('.container'); 45 var container_width = $menu_container.width(); 46 47 var $menu_items = $(this).find('> ul > li'); 48 49 if (js_venedor_vars.menu_item_padding == 'dynamic' && menu_container_width != container_width) { 50 var menu_len = $menu_items.length; 51 52 $menu_items.find('> a, > h5').css({ 53 'padding-left': 0, 54 'padding-right': 0, 55 'transition': 'none' 56 }); 57 var $menu_wrap = $(this).find('> ul'); 58 var menu_width = $menu_wrap.outerWidth(); 59 var menu_gap = container_width - menu_width; 60 var menu_padding = menu_gap / menu_len / 2 - 0.1; 61 62 $menu_items.find('> a, > h5').css({ 63 'padding-left': menu_padding, 64 'padding-right': menu_padding, 65 'transition': 'none' 66 }); 67 } 68 69 $menu_items.each( function(i) { 70 var $menu_item = $( $menu_items[i] ); 71 var $popup = $menu_item.find('.popup'); 72 if ($popup.length > 0) { 73 $popup.css('display', 'block'); 74 if ($menu_item.hasClass('wide')) { 75 $popup.css('left', 0); 76 77 var row_number; 78 var col_length = 0; 79 $popup.find('> .inner > ul > li').each(function() { 80 var cols = parseInt($(this).attr('data-cols')); 81 if (cols < 1) 82 cols = 1; 83 col_length += cols; 84 }) 85 86 if ($menu_item.hasClass('col-2')) row_number = 2; 87 if ($menu_item.hasClass('col-3')) row_number = 3; 88 if ($menu_item.hasClass('col-4')) row_number = 4;
89 if ($menu_item.hasClass('col-5')) row_number = 5; 90 if ($menu_item.hasClass('col-6')) row_number = 6; 91 92 if (col_length > row_number) col_length = row_number; 93 94 var col_width = container_width / row_number; 95 96 $popup.find('> .inner > ul > li').each(function() { 97 var cols = parseFloat($(this).attr('data-cols')); 98 if (cols < 1) 99 cols = 1; 100 $(this).css('width', col_width * cols + 'px'); 101 }); 102 103 if ($menu_item.hasClass('pos-center')) { // position center 104 $popup.find('> .inner > ul').width(col_width * col_length); 105 var left_position = $popup.offset().left - ($(window).width() - col_width * col_length) / 2; 106 $popup.css('left', -left_position); 107 } else if ($menu_item.hasClass('pos-left')) { // position left 108 $popup.find('> .inner > ul').width(col_width * col_length); 109 $popup.css('left', 0); 110 } else if ($menu_item.hasClass('pos-right')) { // position right 111 $popup.find('> .inner > ul').width(col_width * col_length); 112 $popup.css({ 113 'left': 'auto', 114 'right': 0 115 }); 116 } else { // position justify 117 $popup.find('> .inner > ul').width(container_width); 118 var left_position = $popup.offset().left - ($(window).width() - container_width) / 2; 119 $popup.css('left', -left_position); 120 } 121 } 122 $popup.css('display', 'none'); 123 124 var config = { 125 over: function(){ 126 $menu_items.find('.popup').hide(); 127 $popup.stop(true, true).css({ 128 'visibility': 'visible', 129 'overflow': 'visible' 130 }).show(); 131 }, 132 out: function(){ 133 $popup.stop(true, true).css({ 134 'overflow': 'hidden', 135 'visivility': 'hidden' 136 }).hide(); 137 }, 138 sensitivity: 2, 139 interval: 0, 140 timeout: 0 141 }; 142 $menu_item.hoverIntent(config); 143 } 144 }); 145 146 i++; 147 148 if (i == megamenu_len) 149 menu_container_width = container_width; 150 }); 151 } 152 153 var sidebar_menu_container_width = 0; 154 155 function initSidebarMenu() { 156 157 var sidebarmenu_len = $('.sidebar-menu').length; 158 var i = 0; 159 160 $('.sidebar-menu').each( function() { 161 var $this = $(this); 162 var container_width = $('#main > .container').width() - $this.width(); 163 var is_left_sidebar = $('#main').hasClass('column2-left-sidebar'); 164 165 var $menu_items = $(this).find('> ul > li'); 166 167 $menu_items.each( function(i) { 168 var $menu_item = $( $menu_items[i] ); 169 var $popup = $menu_item.find('.popup'); 170 if ($popup.length > 0) { 171 $popup.css('display', 'block'); 172 if ($menu_item.hasClass('wide')) { 173 var row_number; 174 var col_length = 0; 175 $popup.find('> .inner > ul > li').each(function() { 176 var cols = parseInt($(this).attr('data-cols')); 177 if (cols < 1) 178 cols = 1; 179 col_length += cols; 180 }) 181 182 if ($menu_item.hasClass('col-2')) row_number = 2; 183 if ($menu_item.hasClass('col-3')) row_number = 3; 184 if ($menu_item.hasClass('col-4')) row_number = 4;
185 if ($menu_item.hasClass('col-5')) row_number = 5; 186 if ($menu_item.hasClass('col-6')) row_number = 6; 187 188 if (col_length > row_number) col_length = row_number; 189 190 var col_width = container_width / row_number; 191 192 $popup.find('> .inner > ul > li').each(function() { 193 var cols = parseFloat($(this).attr('data-cols')); 194 if (cols < 1) 195 cols = 1; 196 $(this).css('width', col_width * cols + 'px'); 197 }); 198 199 $popup.find('> .inner > ul').width(col_width * col_length); 200 if (is_left_sidebar) { 201 $popup.css({ 202 'left': $this.width(), 203 'right': 'auto' 204 }); 205 } else { 206 $popup.css({ 207 'left': 'auto', 208 'right': $this.width() 209 }); 210 } 211 } 212 $popup.css('display', 'none'); 213 214 var config = { 215 over: function(){ 216 $menu_items.find('.popup').hide(); 217 $popup.stop(true, true).css({ 218 'visibility': 'visible', 219 'overflow': 'visible' 220 }).show(); 221 $popup.parent().addClass('open'); 222 }, 223 out: function(){ 224 $popup.stop(true, true).css({ 225 'overflow': 'hidden', 226 'visivility': 'hidden' 227 }).hide(); 228 $popup.parent().removeClass('open'); 229 }, 230 sensitivity: 2, 231 interval: 0, 232 timeout: 200 233 }; 234 $menu_item.hoverIntent(config); 235 } 236 }); 237 $(this).find('ul li.wide ul li a').on('click',function(){ 238 var $this = $(this); 239 setTimeout(function() { 240 $this.mouseleave(); 241 }, 500); 242 }); 243 244 i++; 245 246 if (i == sidebarmenu_len) 247 sidebar_menu_container_width = container_width; 248 }); 249 } 250 251 function initAccordionMenu() { 252 253 $("#main-mobile-toggle").unbind('click').click(function () { 254 var top = $("#main-mobile-toggle").offset().top - $("#main-mobile-menu").parent().offset().top + $("#main-mobile-toggle").outerHeight( true ); 255 $(this).parent().find('.accordion-menu').css('top', top).slideToggle(400); 256 }); 257 258 $(".accordion-menu, .widget_categories, .widget_pages, .widget_product_categories, .widget_brand_nav.widget_layered_nav").each(function() { 259 $(this).find('> ul > li > ul.children').before( 260 $('<span class="arrow"></span>').unbind('click').click(function() { 261 if ($(this).next().is(":visible")) { 262 $(this).parent().removeClass('open'); 263 } else { 264 $(this).parent().addClass('open'); 265 } 266 $(this).next().slideToggle(200, initScrollBar); 267 }) 268 ); 269 $(this).find('> ul > li[class*="current-"]').addClass('open'); 270 }); 271 272 $(".accordion-menu ul li.has-sub > span.arrow").unbind('click').click(function () { 273 if ($(this).parent().find("> ul.sub-menu").is(":visible")){ 274 $(this).parent().removeClass('open'); 275 } else { 276 $(this).parent().addClass('open'); 277 } 278 $(this).parent().find("> ul.sub-menu").slideToggle(200); 279 }); 280 281 $('.widget_layered_nav h3, .widget_layered_nav_filters h3, .widget_price_filter h3, .widget_product_categories h3').each(function() { 282 var $this = $(this); 283 $this.parent().addClass('open'); 284 if (!$this.find('.toggle').length) { 285 $this.append('<span class="toggle"></span>'); 286 } 287 $this.find('.toggle').unbind('click').click(function() { 288 if ($this.next().is(":visible")){ 289 $this.parent().removeClass('open'); 290 } else { 291 $this.parent().addClass('open'); 292 } 293 $this.next().slideToggle(200); 294 }); 295 }); 296 297 $('.widget_sidebar_menu h3').each(function() { 298 var $this = $(this); 299 $this.parent().addClass('open'); 300 if (!$this.find('.toggle').length) { 301 $this.append('<span class="toggle"></span>'); 302 } 303 $this.find('.toggle').unbind('click').click(function() { 304 if ($this.next().is(":visible")){ 305 $this.parent().removeClass('open'); 306 } else { 307 $this.parent().addClass('open'); 308 } 309 $this.next().slideToggle(200, function() { 310 initSidebarMenu(); 311 }); 312 }); 313 }); 314 } 315 316 function initSearchForm() { 317 var search_input_width = 200; 318 319 $('.header').each(function() { 320 var $header = $(this); 321 var container_width = $header.find('.menu-wrapper > div').width(); 322 var $search_text = $header.find('.searchform input'); 323 if ((container_width >= 768 && container_width <= 940) || (container_width > 940 && $header.find('.search-popup').length)) { 324 $search_text.stop().animate({ 325 width: 0, 326 left: 2 327 }, 400, function() { 328 $(this).hide(); 329 }); 330 } else { 331 $search_text.show().stop().animate({ 332 width: search_input_width, 333 left: -search_input_width 334 }, 400); 335 } 336 $header.find('.searchform button').unbind('click').click(function() { 337 var $search_text = $header.find('.searchform input'); 338 if ($search_text.css('display') == 'none') { 339 $search_text.show().stop().animate({ 340 width: search_input_width, 341 left: -search_input_width 342 }, 400); 343 return false;
344 } 345 var container_width = $header.find('.menu-wrapper > div').width(); 346 if ((container_width >= 768 && container_width <= 940) || (container_width > 940 && $header.find('.search-popup').length)) { 347 if ($search_text.val() == '') { 348 $search_text.stop().animate({ 349 width: 0, 350 left: 2 351 }, 400, function() { 352 $(this).hide(); 353 }); 354 return false; 355 } 356 } 357 }); 358 }); 359 } 360 361 function initHeaderFixed() { 362 if (!$('.sticky-header').length || page_reload) 363 return; 364 365 var container_width = $('.sticky-header .menu-wrapper > .container').width(); 366 if (container_width < 940) { 367 $('.sticky-header').stop().animate({ 368 'top': -$('.sticky-header').outerHeight(true) 369 }, 100, function() { 370 $(this).css({ 371 'visibility': 'hidden', 372 'overflow': 'hidden' 373 }); 374 }); 375 $('.sticky-header .popup').css({ 376 'visibility': 'hidden', 377 'overflow': 'hidden' 378 }); 379 return; 380 } 381 382 var offset = $('.header-wrapper .menu-wrapper').offset(); 383 var offset_top = offset.top + $('.header-wrapper .menu-wrapper').outerHeight(true);// - $('.sticky-header').outerHeight(true); 384 385 var scroll_top = $(window).scrollTop(); 386 387 if (scroll_top > offset_top) { 388 var top = $('#wpadminbar').height() + $('.demo_store').height(); 389 $('.sticky-header').stop().animate({ 390 'top': top 391 }).css({ 392 'visibility': 'visible', 393 'overflow': 'visible' 394 }); 395 return; 396 } else { 397 $('.sticky-header').stop().animate({ 398 'top': -$('.sticky-header').outerHeight(true) 399 }, 100, function() { 400 $(this).css({ 401 'visibility': 'hidden', 402 'overflow': 'hidden' 403 }); 404 }); 405 $('.sticky-header .popup').css({ 406 'visibility': 'hidden', 407 'overflow': 'hidden' 408 }); 409 } 410 } 411 412 function initCategoryHeight() { 413 $('.products.grid.calc-height, .product-carousel.calc-height').each(function() { 414 var $grid = $(this); 415 $grid.find('.product-image > img').imagesLoaded(function() { 416 var winWidth = $(window).width(); 417 var isWide = $grid.hasClass('products-wide'); 418 var cols = 1; 419 if (winWidth >= 992) { 420 cols = isWide ? 4 : 3; 421 } else if (winWidth < 992 && winWidth >= 768) { 422 cols = isWide ? 3 : 2; 423 } else { 424 cols = 1; 425 } 426 var $inner = $grid.find('.inner'); 427 $inner.css('min-height', '0'); 428 setTimeout(function() { 429 var height = 0; 430 var size = $inner.length; 431 var index = 0; 432 var items = new Array(); 433 $inner.each(function() { 434 index++; 435 var $t = $(this); 436 var h = $t.outerHeight(true); 437 if (height < h) height = h; 438 items.push(this); 439 if (index % cols == 0 || index == size) { 440 $.each(items, function(id, value) { 441 $(value).css({ 442 'min-height': height 443 }); 444 }); 445 height = 0; 446 items = new Array(); 447 } 448 }); 449 }, 200); 450 }); 451 }) 452 } 453 454 function initCategoryToggle() { 455 $('.gridlist-toggle > a').click(function() { 456 setTimeout(initCategoryHeight, 500); 457 }); 458 } 459 460 function initTooltip() { 461 $('.product_list_widget .star-rating').each(function() { 462 var rating = $(this).find('.rating').html(); 463 if (parseFloat(rating)) 464 $(this).tooltip({title: rating}); 465 }); 466 $('.yith-wcwl-share li a').each(function(){ 467 if ($(this).hasClass('googleplus')) 468 $(this).tooltip({title: js_venedor_vars.googleplus}); 469 if ($(this).hasClass('pinterest')) 470 $(this).tooltip({title: js_venedor_vars.pinterest}); 471 if ($(this).hasClass('email')) 472 $(this).tooltip({title: js_venedor_vars.email}); 473 $(this).attr('data-toggle', 'tooltip'); 474 }); 475 $("[data-toggle='tooltip']").tooltip(); 476 } 477 478 function initSlider() { 479 var win_width = $(window).width(); 480 var column; 481 if ($('#main').hasClass('column1')) 482 column = 'column1'; 483 else if ($('#main').hasClass('column2')) 484 column = 'column2'; 485 else 486 column = 'column3'; 487 488 $('.product-slider').each(function() { 489 var temp = column; 490 if (!$(this).parents('#main').length) 491 temp = 'column1'; 492 493 var $wrap = $(this); 494 var itemsCustom; 495 if (temp == 'column1') 496 itemsCustom = [[0, 1], [750, 3], [992, 4]]; 497 else if (temp == 'column2') 498 itemsCustom = [[0, 1], [750, 2], [992, 3]]; 499 else 500 itemsCustom = [[0, 1], [750, 1], [992, 2]]; 501 502 if ($wrap.hasClass('sidebar') || $(this).hasClass('single')) {
503 $wrap.find('.product-carousel').owlCarousel({ 504 autoPlay : 5000, 505 singleItem: true, 506 navigation: true, 507 navigationText: ["", ""], 508 pagination: false 509 }); 510 } else { 511 $wrap.find('.product-carousel').owlCarousel({ 512 autoPlay : 5000, 513 itemsCustom: itemsCustom, 514 navigation: true, 515 navigationText: ["", ""], 516 pagination: false 517 }); 518 $wrap.find('h1, h2').each(function() { 519 var $this = $(this); 520 if ($this.find('.inline-title').length) return; 521 var text = $this.html(); 522 $this.html('<span class="inline-title">' + text + '</span><span class="line"></span>'); 523 $this.find('.line').hide(); 524 }); 525 } 526 }); 527 528 $('.related-slider').each(function() { 529 var temp = column; 530 if (!$(this).parents('#main').length) 531 temp = 'column1'; 532 533 var $wrap = $(this); 534 var itemsCustom; 535 if (temp == 'column1') 536 itemsCustom = [[0, 1], [750, 2], [992, 3]]; 537 else if (temp == 'column2') 538 itemsCustom = [[0, 1], [750, 2], [992, 2]]; 539 else 540 itemsCustom = [[0, 1], [750, 1], [992, 2]]; 541 542 if ($wrap.hasClass('sidebar') || $(this).hasClass('single')) { 543 $wrap.find('.post-carousel').owlCarousel({ 544 autoPlay : 5000, 545 singleItem: true, 546 navigation: true, 547 navigationText: ["", ""], 548 pagination: false 549 }); 550 } else { 551 $wrap.find('.post-carousel').owlCarousel({ 552 autoPlay : 5000, 553 itemsCustom: itemsCustom, 554 navigation: true, 555 navigationText: ["", ""], 556 pagination: false 557 }); 558 $wrap.find('h1, h2').each(function() { 559 var $this = $(this); 560 if ($this.find('.inline-title').length) return; 561 var text = $this.html(); 562 $this.html('<span class="inline-title">' + text + '</span><span class="line"></span>'); 563 $this.find('.line').hide(); 564 }); 565 } 566 }); 567 568 $('#main .content-slider').each(function() { 569 var $wrap = $(this); 570 if ($(this).hasClass('single')) { 571 $wrap.parent().find('h1, h2').each(function() { 572 var $this = $(this); 573 if ($this.find('.inline-title').length) return; 574 var text = $this.html(); 575 $this.html('<span class="inline-title">' + text + '</span><span class="line"></span>'); 576 $this.find('.line').hide(); 577 }); 578 } else { 579 $wrap.parent().parent().find('h1, h2').each(function() { 580 var $this = $(this); 581 if ($this.find('.inline-title').length) return; 582 var text = $this.html(); 583 $this.html('<span class="inline-title">' + text + '</span><span class="line"></span>'); 584 $this.find('.line').hide(); 585 }); 586 } 587 }); 588 589 $('.post-slider').each(function() { 590 var temp = column; 591 if (!$(this).parents('#main').length) 592 temp = 'column1'; 593 594 var $wrap = $(this); 595 var itemsCustom; 596 if (temp == 'column1') 597 itemsCustom = [[0, 1], [750, 3], [992, 4]]; 598 else if (temp == 'column2') 599 itemsCustom = [[0, 1], [750, 2], [992, 3]]; 600 else 601 itemsCustom = [[0, 1], [750, 1], [992, 2]]; 602 603 if ($wrap.hasClass('sidebar') || $(this).hasClass('single')) { 604 $wrap.find('.post-carousel').owlCarousel({ 605 autoPlay : 5000, 606 singleItem: true, 607 navigation: true, 608 navigationText: ["", ""], 609 pagination: false 610 }); 611 } else { 612 $wrap.find('.post-carousel').owlCarousel({ 613 autoPlay : 5000, 614 itemsCustom: itemsCustom, 615 navigation: true, 616 navigationText: ["", ""], 617 pagination: false 618 }); 619 } 620 }); 621 622 $('.post-slideshow').each(function(){ 623 624 if (js_venedor_vars.post_slider_zoom != 0) { 625 var $links = []; 626 var i = 0; 627 $(this).find('img').each(function() { 628 $links[i] = $(this).attr('data-image'); 629 i++; 630 }) 631 $(this).parent().find('.zoom-button').unbind('click').click(function(event) { 632 blueimp.Gallery($links); 633 }); 634 } 635 636 $(this).owlCarousel({ 637 autoPlay : 5000, 638 stopOnHover : true, 639 navigation : true, 640 singleItem : true, 641 autoHeight : true, 642 navigationText: false 643 }); 644 }); 645 646 $('.portfolio-slideshow').each(function(){ 647 if (js_venedor_vars.portfolio_slider_zoom != 0) { 648 var $links = []; 649 var i = 0; 650 $(this).find('img').each(function() { 651 $links[i] = $(this).attr('data-image'); 652 i++; 653 }) 654 $(this).parent().find('.zoom-button').unbind('click').click(function(event) { 655 blueimp.Gallery($links); 656 }); 657 } 658 659 $(this).owlCarousel({ 660 autoPlay : 5000, 661 stopOnHover : true, 662 navigation : true, 663 singleItem : true, 664 autoHeight : true, 665 navigationText: false 666 }); 667 }); 668 669 $('.portfolio-wrapper, .entry-related .post-carousel').each(function(){ 670 if (js_venedor_vars.portfolio_slider_zoom != 0) {
671 var $links = $(this).find('a.zoom-button'); 672 $links.unbind('click').click(function(event) { 673 var options = {index: $links.index($(this)), event: event}; 674 blueimp.Gallery($links, options); 675 }); 676 } 677 }); 678 679 $('.recent-posts-slider, .recent-portfolios-slider').owlCarousel({ 680 autoPlay : 5000, 681 stopOnHover : true, 682 navigation : true, 683 singleItem : true, 684 autoHeight : true, 685 navigationText: false, 686 pagination: false 687 }); 688 689 // calculate line width in post title 690 resizeHeadingLine(); 691 } 692 693 function initQuickView() { 694 $('.quickview-button').unbind('click').click(function(e) { 695 e.preventDefault(); 696 var pid = $(this).attr('data-id'); 697 698 var image_es; 699 var zoom_timer; 700 var win_width = 0; 701 702 function resize_venedor_quickview() { 703 clearTimeout(zoom_timer); 704 zoom_timer = setTimeout(refresh_venedor_quickview, 400); 705 }; 706 707 function refresh_venedor_quickview() { 708 if (win_width != $(window).width()) { 709 if ($('#thumbnails-slider-' + pid + ' li').length > 4) { 710 if (image_es) { 711 image_es.destroy(); 712 } 713 image_es = $('#thumbnails-slider-' + pid).elastislide({ 714 orientation : 'vertical', 715 minItems: 4 716 }); 717 } 718 win_width = $(window).width(); 719 } 720 if (zoom_timer) clearTimeout(zoom_timer); 721 } 722 723 function init_venedor_quickview() { 724 refresh_venedor_quickview(); 725 $(window).resize(resize_venedor_quickview); 726 $( '.quickview-wrap form.variations_form .variations select').trigger('change'); 727 } 728 729 function destroy_venedor_quickview() { 730 $(window).unbind('resize', resize_venedor_quickview); 731 $('.quickview-wrap .addthis_button_compact, .quickview-wrap .addthis_bubble_style').unbind('mousemove'); 732 } 733 734 jQuery.fancybox({ 735 'href' : js_venedor_vars.ajax_url, 736 'type' : 'ajax', 737 ajax : { 738 data: { 739 action: 'venedor_product_quickview', 740 pid: pid, 741 context: 'frontend' 742 } 743 }, 744 helpers : { 745 overlay: { 746 locked: false 747 } 748 }, 749 autoSize: false, 750 autoWidth : true, 751 'afterShow' : init_venedor_quickview, 752 'afterClose' : destroy_venedor_quickview 753 }); 754 return false; 755 }); 756 757 $('.product-image .figcaption').show(); 758 } 759 760 function resizeHeadingLine() { 761 var win_width = $(window).width(); 762 $('#main h1, #main h2').each(function() { 763 var $this = $(this); 764 if ($this.find('.line').length) { 765 $this.addClass('line-heading'); 766 $this.find('.line').css('width', $this.width() - $this.find('.inline-title').width() - 35); 767 if ($this.parent().find('> .owl-theme .owl-controls').css('display') == 'none' || $this.next().find('> .owl-theme .owl-controls').css('display') == 'none' || $this.next().next().find('> .owl-theme .owl-controls').css('display') == 'none') 768 $this.find('.line').hide(); 769 else 770 $this.find('.line').css('display', 'inline-block'); 771 } 772 }); 773 } 774 775 function initFitVideos() { 776 if ($(".fit-video").length) 777 $(".fit-video").fitVids(); 778 } 779 780 function initIsotope() { 781 if ($(".grid-layout").length) { 782 $('.grid-layout').each(function() { 783 var $this = $(this); 784 $this.find('.post-item').imagesLoaded(function() { 785 $this.isotope({ 786 // options 787 itemSelector : '.post-item' 788 }); 789 $this.isotope('layout'); 790 }); 791 }); 792 } 793 } 794 795 function initInfiniteScroll() { 796 $(".posts-infinite").infinitescroll({ 797 navSelector : "div.pagination", // selector for the paged navigation (it will be hidden) 798 nextSelector : "a.next", // selector for the NEXT link (to page 2) 799 itemSelector : ".posts-infinite div.post-item, .posts-infinite .timeline-date", // selector for all items
799you'll retrieve 800 loading : { 801 finishedMsg: js_venedor_vars.infinte_blog_finished_msg, 802 msgText: js_venedor_vars.infinte_blog_text 803 }, 804 errorCallback: function() { 805 if ($('.posts-infinite').hasClass('grid-layout')) 806 $('.posts-infinite').isotope('layout'); 807 } 808 }, function(posts) { 809 810 var f = false; 811 812 if ($().isotope) { 813 $(posts).css('top', 'auto').css('left', 'auto'); 814 815 //$(posts).hide(); 816 $(posts).imagesLoaded(function() { 817 //$(posts).fadeIn(); 818 if ($('.posts-infinite').hasClass('grid-layout')) { 819 $('.posts-infinite').isotope('appended', $(posts)); 820 $('.posts-infinite').isotope('layout'); 821 } 822 823 $(posts).each(function() { 824 $(this).find('.fit-video').fitVids(); 825 }); 826 827 initSlider(); 828 initHoverClass(); 829 830 f = true; 831 }); 832 } 833 834 if (!f) { 835 $(posts).each(function() { 836 $(this).find('.fit-video').fitVids(); 837 }); 838 839 initSlider(); 840 initHoverClass(); 841 } 842 }); 843 } 844 845 function initHoverClass() { 846 // add hover class 847 $('.products .product .inner').on("mouseenter",function(){ 848 $(this).addClass('hover'); 849 }).on("mouseleave", function(){ 850 $(this).removeClass('hover'); 851 }); 852 } 853 854 function initWaypoints() { 855 if($().waypoint) { 856 // active parallax effect 857 $('.sw-parallax').waypoint(function() { 858 859 $(this).parallax( 860 "50%", 861 $(this).attr('data-velocity') 862 ); 863 },{offset: '200%'}); 864 865 // progress 866 $('.progress-bar').css('width', '60px'); 867 $('.progress').waypoint(function() { 868 869 var percentage = $(this).find('.progress-bar').attr('aria-valuenow'); 870 $(this).find('.progress-bar').css({ 871 width: percentage+'%' 872 }); 873 }, { 874 triggerOnce: true, 875 offset: '85%' 876 }); 877 878 // counter box 879 $('.counter-box-wrapper').waypoint(function() { 880 881 $(this).find('.display-percentage').each(function() { 882 var percentage = $(this).data('percentage'); 883 $(this).countTo({from: 0, to: percentage, refreshInterval: 10, speed: 1000}); 884 }); 885 }, { 886 triggerOnce: true, 887 offset: '85%' 888 }); 889 890 // counter circle 891 $('.counter-circle-wrapper').waypoint(function() { 892 893 $(this).each(function() { 894 895 var unfilledcolor = $(this).children(".counter-circle-content").attr('data-unfilledcolor'); 896 var filledcolor = $(this).children(".counter-circle-content").attr('data-filledcolor'); 897 var size = $(this).children(".counter-circle-content").attr('data-size'); 898 var speed = $(this).children(".counter-circle-content").attr('data-speed'); 899 var stroksize = $(this).children(".counter-circle-content").attr('data-strokesize'); 900 901 $(this).children(".counter-circle-content").easyPieChart({ 902 barColor: filledcolor, 903 trackColor: unfilledcolor, 904 scaleColor: false, 905 scaleLength: 5, 906 lineCap: "round", 907 lineWidth: stroksize, 908 size: size, 909 rotate: 0, 910 animate: { 911 duration: speed, 912 enabled: true 913 } 914 }); 915 }); 916 }, { 917 triggerOnce: true, 918 offset: '85%' 919 }); 920 921 // animated 922 $('.animated').waypoint(function() { 923 924 // this code is executed for each appeared element 925 var animation_type = $(this).attr('animation_type'); 926 var animation_duration = $(this).attr('animation_duration'); 927 var animation_delay = $(this).attr('animation_delay'); 928 var $this = $(this); 929 930 $this.css('visibility', 'visible'); 931 $this.addClass(animation_type); 932 933 if (animation_duration) { 934 $this.css('-moz-animation-duration', animation_duration+'s'); 935 $this.css('-webkit-animation-duration', animation_duration+'s'); 936 $this.css('-ms-animation-duration', animation_duration+'s'); 937 $this.css('-o-animation-duration', animation_duration+'s'); 938 $this.css('animation-duration', animation_duration+'s'); 939 } 940 if (animation_delay) { 941 $this.css('-moz-animation-delay', animation_delay+'s'); 942 $this.css('-webkit-animation-delay', animation_delay+'s'); 943 $this.css('-ms-animation-delay', animation_delay+'s'); 944 $this.css('-o-animation-delay', animation_delay+'s'); 945 $this.css('animation-delay', animation_delay+'s'); 946 } 947 }, { 948 triggerOnce: true, 949 offset: '85%' 950 }); 951 } 952 } 953 954 function initFilters() { 955 $('.portfolio-filter').each(function() { 956 var $this = $(this); 957 $this.find('a').on('click', function(e) { 958 e.preventDefault(); 959 960 var selector = $(this).attr('data-filter'); 961 $this.find('.active').removeClass('active'); 962 963 $('.grid-layout').isotope({ 964 filter: selector 965 }); 966 967 $(this).addClass('active'); 968 }); 969 }); 970 971 jQuery('.faq-filter a').click(function(e){ 972 e.preventDefault(); 973 974 var selector = $(this).attr('data-filter'); 975 976 $('.faq-wrapper .post-item').stop().fadeOut(); 977 $('.faq-wrapper .post-item'+selector).stop().fadeIn(); 978 979 $(this).parents('ul').find('a').removeClass('active'); 980 $(this).addClass('active'); 981 }); 982 } 983 984 function initScrollBar() { 985 986 $('#mini-cart .cart-content > .cart_list_wrap').scrollbar(); 987 988 if (js_venedor_vars.sidebar_scroll == 1) { 989 $('.widget_product_categories > ul, .widget_layered_nav > ul').each(function() { 990 if ($(this).hasClass('yith-wcan-label') || $(this).hasClass('yith-wcan-color') || $(this).hasClass('yith-wcan-select')) { 991 return; 992 } 993 if (!$(this).find('.scrollwrap').length) { 994 $(this).wrap('<div><div class="scrollwrap scrollbar-rail"></div></div>'); 995 $(this).parent().scrollbar(); 996 } 997 }); 998 } 999 } 1000 1001 function initFileUpload() { 1002 if ($('#contact-file').length) { 1003 document.getElementById("contact-file").onchange = function () { 1004 document.getElementById("contact-file-upload").value = this.value; 1005 }; 1006 } 1007 } 1008 1009 function initFancybox() { 1010 $('.fancybox').fancybox({ 1011 maxWidth : 800, 1012 maxHeight : 600, 1013 fitToView : false, 1014 width : '90%', 1015 height : '70%', 1016 autoSize : false, 1017 closeClick : false, 1018 openEffect : 'none', 1019 closeEffect : 'none' 1020 }); 1021 } 1022 1023 function initVariationForm() { 1024 $( document ).on( 'reset_image found_variation', 'form.variations_form', function( event, variation ) { 1025 var $variations_form = $(this), 1026 $product = $variations_form.closest( '.product' ), 1027 $product_img = $product.find( 'div.images img:eq(0)' ), 1028 $product_link = $product.find( 'div.images a.zoom:eq(0)'), 1029 $product_thumb = $product.find( 'div.thumbnails img:eq(0)' ); 1030 1031 if ($product_img.length) { 1032 var img_src = $product_img.attr('src'); 1033 var img_title = $product_img.attr('title'); 1034 1035 $product_img.attr('data-zoom-image', img_src); 1036 $product_img.attr('srcset', ''); 1037 $product_img.data('zoomImage', img_src); 1038 var $product_zoom = $product_img.data('elevateZoom'); 1039 if ($product_zoom) { 1040 $product_zoom.imageSrc = img_src; 1041 $product_zoom.currentImage = img_src; 1042 if($product_zoom.options.zoomType == "lens" && $product_zoom.zoomLens) { 1043 $product_zoom.zoomLens.css('background-image', 'url('+img_src+')'); 1044 } 1045 if($product_zoom.options.zoomType == "window" && $product_zoom.zoomWindow) { 1046 $product_zoom.zoomWindow.css('background-image', 'url('+img_src+')'); 1047 } 1048 if($product_zoom.options.zoomType == "inner" && $product_zoom.zoomWindow) { 1049 $product_zoom.zoomWindow.css('background-image', 'url('+img_src+')'); 1050 } 1051 } 1052 1053 if ($product_thumb.length) { 1054 $product_thumb.attr('src', img_src); 1055 $product_thumb.parent().attr('data-zoom-image', img_src) 1056 .attr('data-image', img_src) 1057 .attr('title', img_title); 1058 $product_thumb.parent().data('zoomImage', img_src); 1059 $product_thumb.parent().data('image', img_src); 1060 } 1061 } 1062 }); 1063 1064 $('form.variations_form .variations select').trigger('change'); 1065 $('form.variations_form .variations input:radio').trigger('change'); 1066 } 1067 1068 function initBGSlider() { 1069 var $bg_slider = $('#bg-slider .rev_slider'); 1070 var $banner_slider = $('#banner-wrapper .rev_slider'); 1071 var rev_bg = $bg_slider.revolution; 1072 var rev_banner = $banner_slider.revolution; 1073 if (rev_bg != undefined && rev_banner != undefined) { 1074 $banner_slider.bind('revolution.slide.onchange', function(e, data) { 1075 $bg_slider.revshowslide(data.slideIndex); 1076 }); 1077 } 1078 } 1079 1080 function initGridListToggle() { 1081 1082 $('#grid').click(function() { 1083 $(this).addClass('active'); 1084 $('#list').removeClass('active'); 1085 if (($.cookie && $.cookie('gridcookie') == 'list') || !$.cookie) { 1086 var $toggle = $('.gridlist-toggle'); 1087 if ($toggle.length) { 1088 var $parent = $toggle.parents('#main'); 1089 var $products = $parent.find('ul.products'); 1090 $products.fadeOut(300, function() { 1091 $products.addClass('grid').removeClass('list').fadeIn(300); 1092 }); 1093 } 1094 } 1095 if ($.cookie) 1096 $.cookie('gridcookie', 'grid', { path: '/' }); 1097 return false;
1098 }); 1099 1100 $('#list').click(function() { 1101 $(this).addClass('active'); 1102 $('#grid').removeClass('active'); 1103 if (($.cookie && $.cookie('gridcookie') == 'grid') || !$.cookie) { 1104 var $toggle = $('.gridlist-toggle'); 1105 if ($toggle.length) { 1106 var $parent = $toggle.parents('#main'); 1107 var $products = $parent.find('ul.products'); 1108 $products.fadeOut(300, function() { 1109 $products.addClass('list').removeClass('grid').fadeIn(300); 1110 }); 1111 } 1112 } 1113 if ($.cookie) 1114 $.cookie('gridcookie', 'list', { path: '/' }); 1115 return false; 1116 }); 1117 1118 var $toggle = $('.gridlist-toggle'); 1119 var view = ''; 1120 if ($toggle.length) 1121 view = $toggle.data('view'); 1122 1123 if ($.cookie && $.cookie('gridcookie')) { 1124 if ($toggle.length) { 1125 var $parent = $toggle.parents('#main'); 1126 if (!view) 1127 $parent.find('ul.products').addClass($.cookie('gridcookie')); 1128 } 1129 } 1130 1131 if (!view && $.cookie && $.cookie('gridcookie') == 'grid') { 1132 $('.gridlist-toggle #grid').addClass('active'); 1133 $('.gridlist-toggle #list').removeClass('active'); 1134 } 1135 1136 if (!view && $.cookie && $.cookie('gridcookie') == 'list') { 1137 $('.gridlist-toggle #list').addClass('active'); 1138 $('.gridlist-toggle #grid').removeClass('active'); 1139 } 1140 1141 if (!view && $.cookie && $.cookie('gridcookie') == null) { 1142 var $toggle = $('.gridlist-toggle'); 1143 if ($toggle.length) { 1144 var $parent = $toggle.parents('#main'); 1145 $parent.find('ul.products').addClass($.cookie('gridcookie')); 1146 } 1147 $('.gridlist-toggle #grid').addClass('active'); 1148 if ($.cookie) 1149 $.cookie('gridcookie', 'grid', { path: '/' }); 1150 } 1151 1152 if (view) { 1153 if ($.cookie) 1154 $.cookie('gridcookie', view, { path: '/' }); 1155 } 1156 } 1157 1158 function initQtyField() { 1159 // Quantity buttons 1160 $( 'div.quantity:not(.buttons_added), td.quantity:not(.buttons_added)' ).addClass( 'buttons_added' ).append( '<input type="button" value="+" class="plus" />' ).prepend( '<input type="button" value="-" class="minus" />' ); 1161 1162 // Target quantity inputs on product pages 1163 $( 'input.qty:not(.product-quantity input.qty)' ).each( function() { 1164 var min = parseFloat( $( this ).attr( 'min' ) ); 1165 1166 if ( min && min > 0 && parseFloat( $( this ).val() ) < min ) { 1167 $( this ).val( min ); 1168 } 1169 }); 1170 1171 $( document ).off('click', '.plus, .minus').on( 'click', '.plus, .minus', function() { 1172 1173 // Get values 1174 var $qty = $( this ).closest( '.quantity' ).find( '.qty' ), 1175 currentVal = parseFloat( $qty.val() ), 1176 max = parseFloat( $qty.attr( 'max' ) ), 1177 min = parseFloat( $qty.attr( 'min' ) ), 1178 step = $qty.attr( 'step' ); 1179 1180 // Format values 1181 if ( ! currentVal || currentVal === '' || currentVal === 'NaN' ) currentVal = 0; 1182 if ( max === '' || max === 'NaN' ) max = ''; 1183 if ( min === '' || min === 'NaN' ) min = 0; 1184 if ( step === 'any' || step === '' || step === undefined || parseFloat( step ) === 'NaN' ) step = 1; 1185 1186 // Change the value 1187 if ( $( this ).is( '.plus' ) ) { 1188 1189 if ( max && ( max == currentVal || currentVal > max ) ) { 1190 $qty.val( max ); 1191 } else { 1192 $qty.val( currentVal + parseFloat( step ) ); 1193 } 1194 1195 } else { 1196 1197 if ( min && ( min == currentVal || currentVal < min ) ) { 1198 $qty.val( min ); 1199 } else if ( currentVal > 0 ) { 1200 $qty.val( currentVal - parseFloat( step ) ); 1201 } 1202 1203 } 1204 1205 // Trigger change event 1206 $qty.trigger( 'change' ); 1207 }); 1208 } 1209 1210 function initCategoryMobileFilter() { 1211 $('.filter-toggle').click(function(e) { 1212 var $html = $('html'); 1213 if ($html.hasClass('filter-opened')) { 1214 $html.removeClass('filter-opened'); 1215 $('.filter-overlay').removeClass('active'); 1216 } else { 1217 $html.addClass('filter-opened'); 1218 $('.filter-overlay').addClass('active'); 1219 } 1220 }); 1221 1222 $('.filter-overlay').click(function() { 1223 var $html = $('html'); 1224 $html.removeClass('filter-opened'); 1225 $(this).removeClass('active'); 1226 }); 1227 1228 $(window).on('resize', function() { 1229 var winWidth = $(window).width(); 1230 if (winWidth > 991 - window.innerWidth + $(window).width()) { 1231 $('.filter-overlay').click(); 1232 } 1233 }); 1234 } 1235 1236 function initAjaxRemoveItem() { 1237 $('#mini-cart .remove-product, .widget_shopping_cart .remove-product').unbind('click').click(function(){ 1238 var $this = $(this); 1239 var cart_id = $this.data("cart_id"); 1240 $this.parent().find('.ajax-loading').show(); 1241 1242 $.ajax({ 1243 type: 'POST', 1244 dataType: 'json', 1245 url: js_venedor_vars.ajax_url, 1246 data: { action: "venedor_product_remove", 1247 cart_id: cart_id 1248 },success: function( response ) { 1249 var fragments = response.fragments; 1250 var cart_hash = response.cart_hash; 1251 1252 if ( fragments ) { 1253 $.each(fragments, function(key, value) { 1254 $(key).replaceWith(value); 1255 }); 1256 } 1257 1258 $('#mini-cart .cart-content > .cart_list_wrap').scrollbar(); 1259 } 1260 }); 1261 return false;
1262 }); 1263 1264 $('#mini-cart .cart-content > .cart_list_wrap').scrollbar(); 1265 } 1266 1267 function addAjaxCartClass() { 1268 $('.products a.cart-links.added').addClass('added-cart'); 1269 $('.product-topslider .added_to_cart').addClass('btn btn-lg btn-inverse'); 1270 $('.product-featured-slider .added_to_cart').addClass('btn btn-lg btn-inverse'); 1271 } 1272 1273 function venedor_ajax_complete() { 1274 initTooltip(); 1275 initAjaxRemoveItem(); 1276 addAjaxCartClass(); 1277 initQtyField(); 1278 } 1279 1280 var venedor_timer; 1281 function venedor_resize() { 1282 1283 initSearchForm(); 1284 initHeaderFixed(); 1285 initCategoryHeight(); 1286 initFitVideos(); 1287 initIsotope(); 1288 initScrollBar(); 1289 1290 if (venedorIsMobile.any()) { 1291 $('body').addClass('mobile'); 1292 } else { 1293 initMegaMenu(); 1294 } 1295 1296 initSidebarMenu(); 1297 1298 if ($("#main-mobile-toggle").length) { 1299 var top = $("#main-mobile-toggle").offset().top - $("#main-mobile-menu").parent().offset().top + $("#main-mobile-toggle").outerHeight( true ); 1300 $('#main-mobile-toggle').parent().find('.accordion-menu').css('top', top); 1301 } 1302 1303 // calculate line width in post title 1304 resizeHeadingLine(); 1305 1306 if (venedor_timer) clearTimeout(venedor_timer); 1307 } 1308 1309 function venedor_init() { 1310 1311 initAccordionMenu(); 1312 initCategoryToggle(); 1313 initTooltip(); 1314 initFilters(); 1315 initSlider(); 1316 initQuickView(); 1317 initInfiniteScroll(); 1318 initHoverClass(); 1319 initWaypoints(); 1320 initFileUpload(); 1321 initFancybox(); 1322 initVariationForm(); 1323 initBGSlider(); 1324 initAjaxRemoveItem(); 1325 initGridListToggle(); 1326 initQtyField(); 1327 initCategoryMobileFilter(); 1328 1329 // init addthis 1330 if (window.addthis) { 1331 addthis.init(); 1332 } 1333 1334 // bootstrap dropdown hover 1335 $('[data-toggle="dropdown"]').dropdownHover(); 1336 1337 // disable default hide dropdown popup 1338 if (!venedorIsMobile.any()) { 1339 $('.mini-cart').on('hide.bs.dropdown', function () { 1340 return false; 1341 }); 1342 } 1343 1344 // replace wishlist ajax-loading img tag 1345 $('.yith-wcwl-add-to-wishlist img.ajax-loading').replaceWith('<span class="ajax-loading"></span>'); 1346 1347 // scroll top control 1348 scrolltotop.controlHTML = '<div class="btn btn-special"><span class="fa fa-angle-up"></span></div>'; 1349 scrolltotop.controlattrs = {offsetx:15, offsety:15}; 1350 scrolltotop.init(); 1351 1352 $('body').on('click', function(e){ 1353 if( !$(e.target).hasClass('yit-wcan-select-open') ) { 1354 $('div.yith-wcan-select-wrapper').css("z-index", "-1"); 1355 } 1356 }); 1357 1358 venedor_resize(); 1359 } 1360 1361 $(document).ajaxComplete(function(event, xhr, settings) { 1362 venedor_ajax_complete(); 1363 }) 1364 1365 $(window).resize(function() { 1366 clearTimeout(venedor_timer); 1367 venedor_timer = setTimeout(venedor_resize, 400); 1368 }); 1369 1370 $(document).ready(function(){ 1371 venedor_init(); 1372 $(window).scroll(function(){ 1373 initHeaderFixed(); 1374 }); 1375 }); 1376 1377 $(window).bind('vc_reload', function() { 1378 venedor_init(); 1379 $('.type-product').addClass('product'); 1380 $('.type-post').addClass('post'); 1381 $('.type-portfolio').addClass('portfolio'); 1382 $('.type-block').addClass('block'); 1383 }); 1384 1385 // Ajax Navigation Call back 1386 $(document).on('yith-wcan-ajax-filtered', initAjaxFilter); 1387 1388 if (typeof yith_wcan != 'undefined') { 1389 yith_wcan.container = '.products'; 1390 yith_wcan.pagination = 'nav.woocommerce-pagination'; 1391 yith_wcan.result_count = '.woocommerce-result-count'; 1392 } 1393 1394 $(document).on('click', '.yith-wcan a', function(e){ 1395 if (typeof yith_wcan != 'undefined') { 1396 var winWidth = $(window).width(); 1397 if (winWidth <= 991 - window.innerWidth + $(window).width()) { 1398 $('.filter-overlay').click(); 1399 } 1400 $('html, body').stop().animate({ 1401 scrollTop: $(yith_wcan.pagination).offset().top - ($('.sticky-header').length && $(window).width() > 991 ? $('.sticky-header').height() + 30 : ($(window).width() > 767 ? 40 : 50)) 1402 }, 600, 'easeOutQuad'); 1403 } 1404 }); 1405 1406 function initAjaxFilter() { 1407 if (typeof yith_wcan != 'undefined') { 1408 if ($(yith_wcan.container).find('.product').length) { 1409 $(yith_wcan.pagination).show(); 1410 $(yith_wcan.result_count).show(); 1411 } else { 1412 $(yith_wcan.pagination).hide(); 1413 $(yith_wcan.result_count).hide(); 1414 } 1415 if (jQuery.cookie('gridcookie')) { 1416 $(yith_wcan.container).addClass($.cookie('gridcookie')); 1417 } 1418 $(yith_wcan.pagination).find('[data-toggle="dropdown"]').dropdownHover(); 1419 $(yith_wcan.result_count).find('[data-toggle="dropdown"]').dropdownHover(); 1420 } 1421 1422 initCategoryHeight(); 1423 initHoverClass(); 1424 initQuickView(); 1425 initAccordionMenu(); 1426 initGridListToggle(); 1427 } 1428 1429}(jQuery)); 1430 1431var wpml_language_selector_click = { 1432 ls_click_flag: false, 1433 toggle: function(){ 1434 var $sel = jQuery('.lang_sel_click').find('>ul>li>ul'); 1435 if($sel.css('visibility') == 'visible'){ 1436 $sel.css('visibility', 'hidden'); 1437 document.removeEventListener('click', wpml_language_selector_click.close); 1438 }else{ 1439 $sel.css('visibility', 'visible'); 1440 document.addEventListener('click', wpml_language_selector_click.close); 1441 wpml_language_selector_click.ls_click_flag = true; 1442 } 1443 return false;
1444 }, 1445 close: function(e){ 1446 if(!wpml_language_selector_click.ls_click_flag){ 1447 var $sel = jQuery('.lang_sel_click').find('>ul>li>ul'); 1448 $sel.css('visibility', 'hidden'); 1449 } 1450 wpml_language_selector_click.ls_click_flag = false; 1451 } 1452};
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.