1(function($) { 2 $.fn.thegemPreloader = function(callback) { 3 $(this).each(function() { 4 var $el = $(this), 5 hasSrc = ['img', 'iframe'].indexOf($el[0].nodeName.toLowerCase()) != -1; 6 7 $el.data('thegemPreloader', $('img, iframe', $el).add($el.filter('img, iframe')).length); 8 9 if ($el.data('thegemPreloader') == 0 || (hasSrc && !$el.attr('src'))) { 10 $el.prev('.preloader').remove(); 11 callback(); 12 $el.trigger('thegem-preloader-loaded'); 13 return; 14 } 15 16 if(!$el.prev('.preloader').length) { 17 $('<div class="preloader">').insertBefore($el); 18 } 19 20 $('img, iframe', $el).add($el.filter('img, iframe')).each(function() { 21 function preloaderItemLoaded() { 22 $el.data('thegemPreloader', $el.data('thegemPreloader')-1); 23 if($el.data('thegemPreloader') == 0) { 24 $el.prev('.preloader').remove(); 25 callback(); 26 $el.trigger('thegem-preloader-loaded'); 27 } 28 } 29 30 if (!$(this).attr('src')) { 31 preloaderItemLoaded(); 32 return; 33 } 34 35 var $obj = $('<img>'); 36 if($(this).prop('tagName').toLowerCase() == 'iframe') { 37 $obj = $(this); 38 } 39 $obj.attr('src', $(this).attr('src')); 40 $obj.on('load error', preloaderItemLoaded); 41 }); 42 }); 43 } 44})(jQuery); 45 46(function($) { 47 48 var oWidth=$.fn.width; 49 $.fn.width=function(argument) { 50 if (arguments.length==0 && this.length==1 && this[0]===window) { 51 if (window.gemOptions.innerWidth != -1) { 52 return window.gemOptions.innerWidth; 53 } 54 var width = oWidth.apply(this,arguments); 55 window.updateGemInnerSize(width); 56 return width; 57 } 58 59 return oWidth.apply(this,arguments); 60 }; 61 62 var $page = $('#page'); 63 64 $(window).on('load', function() { 65 var $preloader = $('#page-preloader'); 66 if ($preloader.length && !$preloader.hasClass('preloader-loaded')) { 67 $preloader.addClass('preloader-loaded'); 68 } 69 }); 70 71 $.fn.updateTabs = function() { 72 73 jQuery('.gem-tabs', this).each(function(index) { 74 var $tabs = $(this); 75 $tabs.thegemPreloader(function() { 76 $tabs.easyResponsiveTabs({ 77 type: 'default', 78 width: 'auto', 79 fit: false, 80 activate: function(currentTab, e) { 81 var $tab = $(currentTab.target); 82 var controls = $tab.attr('aria-controls'); 83 $tab.closest('.ui-tabs').find('.gem_tab[aria-labelledby="' + controls + '"]').trigger('tab-update'); 84 } 85 }); 86 }); 87 }); 88 89 jQuery('.gem-tour', this).each(function(index) { 90 var $tabs = $(this); 91 $tabs.thegemPreloader(function() { 92 $tabs.easyResponsiveTabs({ 93 type: 'vertical', 94 width: 'auto', 95 fit: false, 96 activate: function(currentTab, e) { 97 var $tab = $(currentTab.target); 98 var controls = $tab.attr('aria-controls'); 99 $tab.closest('.ui-tabs').find('.gem_tab[aria-labelledby="' + controls + '"]').trigger('tab-update'); 100 } 101 }); 102 }); 103 }); 104 105 }; 106 107 function fullwidth_block_after_update($item) { 108 $item.trigger('updateTestimonialsCarousel'); 109 $item.trigger('updateClientsCarousel'); 110 $item.trigger('fullwidthUpdate'); 111 } 112 113 function fullwidth_block_update($item, pageOffset, pagePaddingLeft, pageWidth,skipTrigger) { 114 var $prevElement = $item.prev(), 115 extra_padding = 0; 116 if ($prevElement.length == 0 || $prevElement.hasClass('fullwidth-block') || $prevElement.is('style')) { 117 $prevElement = $item.parent(); 118 extra_padding = parseInt($prevElement.css('padding-left')); 119 } 120 121 var offsetKey = window.gemSettings.isRTL ? 'right' : 'left'; 122 var cssData = { 123 width: pageWidth 124 }; 125 cssData[offsetKey] = pageOffset.left - ($prevElement.length ? $prevElement.offset().left - parseInt($prevElement.css('margin-left')) : 0) + parseInt(pagePaddingLeft) - extra_padding; 126 127 $item.css(cssData); 128 129 if (!skipTrigger) { 130 fullwidth_block_after_update($item); 131 } 132 } 133 134 var inlineFullwidths = [], 135 notInlineFullwidths = []; 136 137 $('.fullwidth-block').each(function() { 138 var $item = $(this), 139 $parents = $item.parents('.vc_row'), 140 fullw = { 141 isInline: false 142 }; 143 144 $parents.each(function() { 145 if (this.hasAttribute('data-vc-full-width')) { 146 fullw.isInline = true; 147 return false; 148 } 149 }); 150 151 if (fullw.isInline) { 152 inlineFullwidths.push(this); 153 } else { 154 notInlineFullwidths.push(this); 155 } 156 }); 157 158 function update_fullwidths(inline, init) { 159 var $needUpdate = []; 160
161 (inline ? inlineFullwidths : notInlineFullwidths).forEach(function(item) { 162 $needUpdate.push(item); 163 }); 164 165 if ($needUpdate.length > 0) { 166 var pageOffset = $page.offset(), 167 pagePaddingLeft = $page.css('padding-left'), 168 pageWidth = $page.width(); 169 170 $needUpdate.forEach(function(item) { 171 fullwidth_block_update($(item), pageOffset, pagePaddingLeft, pageWidth); 172 }); 173 } 174 } 175 176 if (!window.disableGemSlideshowPreloaderHandle) { 177 jQuery('.gem-slideshow-with-preloader:not(.gem-slideshow-rs)').each(function() { 178 var $slideshow = $(this); 179 $slideshow.thegemPreloader(function() {}); 180 }); 181 } 182 183 var revapi = jQuery(document).ready(function() {}); 184 revapi.one('revolution.slide.onloaded', function() { 185 jQuery('.gem-slideshow').prev('.slideshow-preloader').remove(); 186 }); 187 188 $(function() { 189 $('#gem-icons-loading-hide').remove(); 190 191 if (window.tgpLazyItems===undefined) { 192 $('#thegem-preloader-inline-css').remove(); 193 } 194 195 /*jQuery('iframe').not('.gem-video-background iframe, .wcppec-checkout-buttons iframe').each(function() { 196 $(this).thegemPreloader(function() {}); 197 });*/ 198 199 jQuery('.gem-video-background').each(function() { 200 var $videoBG = $(this); 201 var $videoContainer = $('.gem-video-background-inner', this); 202 var ratio = $videoBG.data('aspect-ratio') ? $videoBG.data('aspect-ratio') : '16:9'; 203 var regexp = /(\d+):(\d+)/; 204 var $fullwidth = $videoBG.closest('.fullwidth-block'); 205 ratio = regexp.exec(ratio); 206 if(!ratio || parseInt(ratio[1]) == 0 || parseInt(ratio[2]) == 0) { 207 ratio = 16/9; 208 } else { 209 ratio = parseInt(ratio[1])/parseInt(ratio[2]); 210 } 211 212 function gemVideoUpdate() { 213 $videoContainer.removeAttr('style'); 214 if($videoContainer.width() / $videoContainer.height() > ratio) { 215 $videoContainer.css({ 216 height: ($videoContainer.width() / ratio) + 'px', 217 marginTop: -($videoContainer.width() / ratio - $videoBG.height()) / 2 + 'px' 218 }); 219 } else { 220 $videoContainer.css({ 221 width: ($videoContainer.height() * ratio) + 'px', 222 marginLeft: -($videoContainer.height() * ratio - $videoBG.width()) / 2 + 'px' 223 }); 224 } 225 } 226 227 if ($videoBG.closest('.page-title-block').length > 0) { 228 gemVideoUpdate(); 229 } 230 231 if ($fullwidth.length) { 232 $fullwidth.on('fullwidthUpdate', gemVideoUpdate); 233 } else { 234 $(window).resize(gemVideoUpdate); 235 } 236 }); 237 238 update_fullwidths(false, true); 239 240 241 $('.fullwidth-block').each(function() { 242 var $item = $(this), 243 mobile_enabled = $item.data('mobile-parallax-enable') || '0', 244 is_custom_title = $item.hasClass('custom-title-background'); 245 246 if (!window.gemSettings.isTouch || mobile_enabled == '1') { 247 if ($item.hasClass('fullwidth-block-parallax-vertical')) { 248 var parallaxOptions = {}; 249 if (is_custom_title) { 250 parallaxOptions.position = 'top'; 251 } 252 253 $('.fullwidth-block-background', $item).each(function() { 254 var backgroundImageCss = $(this).css('background-image') || ''; 255 256 if (backgroundImageCss == 'none' || backgroundImageCss == '') { 257 $(this).on('tgpliVisible', function() { 258 $(this).parallaxVertical('50%', parallaxOptions); 259 }); 260 261 return; 262 } 263 264 $(this).parallaxVertical('50%', parallaxOptions); 265 }); 266 } else if ($item.hasClass('fullwidth-block-parallax-horizontal')) { 267 $('.fullwidth-block-background', $item).each(function() { 268 if (!window.gemSettings.parallaxDisabled) { 269 var backgroundImageCss = $(this).css('background-image') || ''; 270 271 if (backgroundImageCss == 'none' || backgroundImageCss == '') { 272 $(this).on('tgpliVisible', function() { 273 $(this).parallaxHorizontal(); 274 }); 275 276 return; 277 } 278 279 $(this).parallaxHorizontal(); 280 } 281 }); 282 } 283 } else { 284 $('.fullwidth-block-background', $item).css({ 285 backgroundAttachment: 'scroll' 286 }); 287 } 288 }); 289 290 if(!window.gemSettings.isTouch) { 291 $('.page-title-parallax-background').each(function() { 292 var backgroundImageCss = $(this).css('background-image') || ''; 293 if (backgroundImageCss == 'none' || backgroundImageCss == '') { 294 $(this).on('tgpliVisible', function() { 295 $(this).parallaxVertical('50%', { 296 position: 'top' 297 }); 298 }); 299 return; 300 } 301 302 $(this).parallaxVertical('50%', { 303 position: 'top' 304 }); 305 }); 306 } else { 307 $('.page-title-parallax-background').css({ 308 backgroundAttachment: 'scroll' 309 }); 310 } 311 312 313 314 $(window).resize(function() { 315 update_fullwidths(false, false); 316 }); 317 318 $(window).on('load', function() { 319 update_fullwidths(false, false); 320 }); 321 322 jQuery('select.gem-combobox, .gem-combobox select, .widget_archive select').each(function(index) { 323 $(this).combobox(); 324 }); 325 326 jQuery('.widget_categories select').each(function() { 327 this.onchange = null; 328 $(this).on('change', function() { 329 if($(this).val() != -1) { 330 $(this).closest('form').submit(); 331 } 332 }); 333 }); 334 335 jQuery('input.gem-checkbox, .gem-checkbox input').each(function(index) { 336 $(this).checkbox(); 337 }); 338 339 if (typeof($.fn.ReStable) == "function") { 340 jQuery('.gem-table-responsive').each(function(index) { 341 $('> table', this).ReStable({ 342 maxWidth: 768, 343 rowHeaders : $(this).hasClass('row-headers') 344 }); 345 }); 346 } 347 348 jQuery('.fancybox').each(function() { 349 $(this).fancybox(); 350 }); 351 352 jQuery(document).on('click', 'a[href^="%thegem-action"], a[href^="#thegem-action"]', function(e) { 353 thegemRunClickAction(e); 354 }); 355 356 thegemLightbox = function(settings) { 357 console.log(settings); 358 jQuery.fancybox.open({ 359 src: settings.url 360 }); 361 } 362 363 thegemPopupOpen = function(settings) { 364 if(settings.id && jQuery('#thegem-dynamic-popup-' + settings.id).length) { 365 jQuery.fancybox.open({ 366 src: '#thegem-dynamic-popup-' + settings.id, 367 type: 'inline' 368 }); 369 } 370 } 371 372 thegemPopupClose = function() { 373 $.fancybox.close(); 374 } 375 376 thegemClickAction = function(url) { 377 thegemActions = { 378 lightbox: thegemLightbox, 379 popupOpen: thegemPopupOpen, 380 popupClose: thegemPopupClose, 381 }; 382 url = decodeURIComponent(url); 383 const actionMatch = url.match(/action=(.+?)&/); 384 if (!actionMatch) { 385 return; 386 } 387 const action = thegemActions[actionMatch[1]]; 388 if (!action) { 389 return; 390 } 391 let settings = {};
392 const settingsMatch = url.match(/settings=(.+)/); 393 if (settingsMatch) { 394 settings = JSON.parse(atob(settingsMatch[1])); 395 } 396 settings.previousEvent = event; 397 for (var _len = arguments.length, restArgs = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { 398 restArgs[_key - 1] = arguments[_key]; 399 } 400 action(settings, ...restArgs); 401 } 402 thegemRunClickAction = function(event) { 403 event.preventDefault(); 404 this.thegemClickAction(jQuery(event.currentTarget).attr('href'), event); 405 } 406 407 if (typeof jQuery.fn.scSticky === 'function') { 408 jQuery('.panel-sidebar-sticky > .sidebar').scSticky(); 409 } 410 411 if (typeof jQuery.fn.sticky === 'function') { 412 stickyColumns(); 413 414 function stickyColumns() { 415 416 const $header = $('#site-header-wrapper'), 417 headerH = $header.length > 0 ? $header[0].clientHeight : 0, 418 offset = headerH - 1; 419 420 $('.thegem-column-sticky .elementor-column-wrap, .thegem-column-sticky > .elementor-widget-wrap').each(function (){ 421 422 if ($(this).data('sticky')) { 423 $(this).sticky('destroy'); 424 } 425 426 const stickyTo = $(this).parent().data('sticky-to') ? $(this).parent().data('sticky-to') : 'top', 427 stickyOffset = $(this).parent().data('sticky-offset') !== '' ? $(this).parent().data('sticky-offset') : stickyTo === 'bottom' ? 0 : offset; 428 429 $(this).sticky({ 430 to: stickyTo, 431 offset: stickyOffset, 432 effectsOffset: stickyOffset, 433 parent: 'parent', 434 spacerHide: '.elementor-element' 435 }); 436 }); 437 } 438 } 439 440 jQuery('iframe + .map-locker').each(function() { 441 var $locker = $(this); 442 $locker.click(function(e) { 443 e.preventDefault(); 444 if($locker.hasClass('disabled')) { 445 $locker.prev('iframe').css({ 'pointer-events' : 'none' }); 446 } else { 447 $locker.prev('iframe').css({ 'pointer-events' : 'auto' }); 448 } 449 $locker.toggleClass('disabled'); 450 }); 451 }); 452 453 $('.primary-navigation a.mega-no-link').closest('li').removeClass('menu-item-active current-menu-item'); 454 455 function getElementPagePosition(element) { 456 var width = element.offsetWidth, 457 height = element.offsetHeight, 458 left = 0, 459 top = 0; 460 461 while (element && element.id != 'page') { 462 left += element.offsetLeft; 463 top += element.offsetTop; 464 element = element.offsetParent; 465 } 466
467 return {"left": left, "top": top, "width": width, "height": height}; 468 } 469 470 var $anhorsElements = []; 471 $('a[href*="#"]').not('[data-vc-accordion], [data-vc-tabs], .scroll-to-content').each(function(e) { 472 var $anhor = $(this); 473 var link = $anhor.attr('href'); 474 if(!link) return ; 475 link = link.split('#'); 476 try { 477 if($('#'+link[1]).hasClass('vc_tta-panel')) return ; 478 if($('#'+link[1]).length) { 479 $anhor.closest('li').removeClass('menu-item-active current-menu-item'); 480 $anhor.closest('li').parents('li').removeClass('menu-item-current'); 481 $(document).on('update-page-scroller', function(e, elem) { 482 var $elem = $(elem); 483 if(!$anhor.closest('li.menu-item').length) return ; 484 if($elem.is($('#'+link[1])) || $elem.find($('#'+link[1])).length) { 485 $anhor.closest('li').addClass('menu-item-active'); 486 $anhor.closest('li').parents('li').addClass('menu-item-current'); 487 } else { 488 $anhor.closest('li').removeClass('menu-item-active'); 489 $anhor.closest('li').parents('li.menu-item-current').each(function() { 490 if(!$('.menu-item-active', this).length) { 491 $(this).removeClass('menu-item-current'); 492 } 493 }); 494 } 495 }); 496 $anhor.click(function(e) { 497 e.preventDefault(); 498 history.replaceState('data to be passed', $anhor.text(), $anhor.attr('href')); 499 var correction = 0; 500 var isPerspectiveMenu = $('#thegem-perspective.modalview').length; 501 502 if($('#site-header.animated-header').length) { 503 var shrink = $('#site-header').hasClass('shrink'); 504 $('#site-header').addClass('scroll-counting'); 505 $('#site-header').addClass('fixed shrink'); 506 correction = $('#site-header').outerHeight(); 507 if (!isPerspectiveMenu) { 508 var siteHeaderTop = $('#site-header').position().top; 509 if ($('#site-header').hasClass('shrink')) { 510 siteHeaderTop = 0; 511 } 512 correction += siteHeaderTop; 513 } 514 515 if(!shrink) { 516 $('#site-header').removeClass('fixed shrink'); 517 } 518 setTimeout(function() { 519 $('#site-header').removeClass('scroll-counting'); 520 }, 50); 521 } 522 if($('#site-header.header-sticky').length && $('.header-sticky-template').length) { 523 correction = $('.header-sticky-template').outerHeight(); 524 } 525 var target_top = getElementPagePosition( $('#'+link[1])[0] ).top - correction + 1; 526 if(getElementPagePosition( $('#'+link[1])[0] ).top == 0) { target_top = 0; } 527 if($('body').hasClass('page-scroller') && $('.page-scroller-nav-pane').is(':visible')) { 528 var $block = $('#'+link[1]+'.scroller-block').add($('#'+link[1]).closest('.scroller-block')).eq(0); 529 if($block.length) { 530 $('.page-scroller-nav-pane .page-scroller-nav-item').eq($('.scroller-block').index($block)).trigger('click'); 531 } 532 if($anhor.closest('.overlay-menu-wrapper').length && $anhor.closest('.overlay-menu-wrapper').hasClass('active')) { 533 if($anhor.closest('#primary-navigation').length && $anhor.closest('#primary-navigation').hasClass('responsive')) { 534 $anhor.closest('.thegem-te-menu').find('.menu-toggle').trigger('click'); 535 $anhor.closest('#primary-navigation').find('.menu-toggle').trigger('click'); 536 } else { 537 $anhor.closest('.thegem-te-menu').find('.overlay-toggle').trigger('click'); 538 $anhor.closest('#primary-navigation').find('.overlay-toggle').trigger('click'); 539 } 540 } 541 } else { 542 if (isPerspectiveMenu) { 543 $('#page').stop(true, true).animate({scrollTop:target_top}, 1500, 'easeInOutCubic', function() { 544 if($anhor.closest('#thegem-perspective').length && $anhor.closest('#thegem-perspective').hasClass('modalview')) { 545 $anhor.closest('.thegem-te-menu').find('.perspective-menu-close').trigger('click'); 546 $anhor.closest('#primary-navigation').find('.perspective-menu-close').trigger('click'); 547 } 548 }); 549 } else { 550 $('html, body').stop(true, true).animate({scrollTop:target_top}, 1500, 'easeInOutCubic'); 551 } 552 if($anhor.closest('#primary-menu').length && $anhor.closest('#primary-menu').hasClass('dl-menuopen')) { 553 $anhor.closest('.thegem-te-menu').find('.menu-toggle').trigger('click'); 554 $anhor.closest('#primary-navigation').find('.menu-toggle').trigger('click'); 555 } 556 if($anhor.closest('.mobile-menu-slide-wrapper').length && $anhor.closest('.mobile-menu-slide-wrapper').hasClass('opened')) { 557 $anhor.closest('.thegem-te-menu').find('.mobile-menu-slide-close').trigger('click'); 558 $anhor.closest('#primary-navigation').find('.mobile-menu-slide-close').trigger('click'); 559 } 560 if($anhor.closest('.overlay-menu-wrapper').length && $anhor.closest('.overlay-menu-wrapper').hasClass('active')) { 561 if($anhor.closest('#primary-navigation').length && $anhor.closest('#primary-navigation').hasClass('responsive')) { 562 $anhor.closest('.thegem-te-menu').find('.menu-toggle').trigger('click'); 563 $anhor.closest('#primary-navigation').find('.menu-toggle').trigger('click'); 564 } else { 565 $anhor.closest('.thegem-te-menu').find('.overlay-toggle-close').trigger('click'); 566 $anhor.closest('#primary-navigation').find('.overlay-toggle-close').trigger('click'); 567 } 568 } 569 if($anhor.closest('#primary-navigation').length && $anhor.closest('#primary-navigation').hasClass('hamburger-active')) { 570 $anhor.closest('.thegem-te-menu').find('.hamburger-toggle').trigger('click'); 571 $anhor.closest('#primary-navigation').find('.hamburger-toggle').trigger('click'); 572 } 573 } 574 }); 575 $anhorsElements.push($anhor[0]); 576 } 577 } catch(e) { return; } 578 }); 579 580 if ($anhorsElements.length) { 581 function anchorLinksScroll() { 582 var isPerspectiveMenu = $('#thegem-perspective.modalview').length; 583 var correction = 0; 584 585 if (!$page.hasClass('vertical-header')) { 586 correction = $('#site-header').outerHeight(); 587 if (!isPerspectiveMenu) { 588 var siteHeaderTop = $('#site-header').length ? $('#site-header').position().top : 0; 589 if ($('#site-header').hasClass('shrink')) { 590 siteHeaderTop = 0; 591 } 592 correction += siteHeaderTop; 593 } 594 } 595 596 if($('#site-header.header-sticky').length && $('.header-sticky-template').length) { 597 correction = $('.header-sticky-template').outerHeight(); 598 } 599 600 for (var i = 0; i < $anhorsElements.length; i++) { 601 var $anhor = $($anhorsElements[i]);
602 var link = $anhor.attr('href'); 603 if(!link) continue ; 604 link = link.split('#'); 605 var scrollY = getScrollY() + $page.scrollTop(); 606 607 if(!$anhor.closest('li.menu-item').length) continue ; 608 var target_top = getElementPagePosition( $('#'+link[1])[0] ).top - correction; 609 if(scrollY >= target_top && scrollY <= target_top + $('#'+link[1]).outerHeight()) { 610 $anhor.closest('li').addClass('menu-item-active'); 611 $anhor.closest('li').parents('li').addClass('menu-item-current'); 612 } else { 613 $anhor.closest('li').removeClass('menu-item-active'); 614 $anhor.closest('li').parents('li.menu-item-current').each(function() { 615 if(!$('.menu-item-active', this).length) { 616 $(this).removeClass('menu-item-current'); 617 } 618 }); 619 } 620 } 621 } 622 623 $(window).scroll(anchorLinksScroll); 624 if ($('#thegem-perspective').length) { 625 $page.scroll(anchorLinksScroll); 626 } 627 628 $(window).on('load', function() { 629 for (var i = 0; i < $anhorsElements.length; i++) { 630 var anhor = $anhorsElements[i]; 631 if (anhor.href != undefined && anhor.href && window.location.href == anhor.href) { 632 anhor.click(); 633 break; 634 } 635 } 636 }); 637 } 638 639 $('body').on('click', '.post-footer-sharing .gem-button', function(e) { 640 e.stopPropagation(); 641 e.preventDefault(); 642 $(this).closest('.post-footer-sharing').find('.sharing-popup').toggleClass('active'); 643 }); 644 645 var scrollTimer, 646 body = document.body; 647 648 $(window).scroll(function() { 649 clearTimeout(scrollTimer); 650 if(!body.classList.contains('disable-hover')) { 651 //body.classList.add('disable-hover') 652 } 653 654 scrollTimer = setTimeout(function(){ 655 //body.classList.remove('disable-hover') 656 }, 300); 657 658 if(getScrollY() > 0) { 659 $('.scroll-top-button').addClass('visible'); 660 } else { 661 $('.scroll-top-button').removeClass('visible'); 662 } 663 }).scroll(); 664 665 function getScrollY(elem){ 666 return window.pageYOffset || document.documentElement.scrollTop; 667 } 668 669 $('a.hidden-email').each(function() { 670 $(this).attr('href', 'mailto:'+$(this).data('name')+'@'+$(this).data('domain')); 671 }); 672 673 var initFooterWidgetArea = function() { 674 if (window.tgpLazyItems !== undefined) { 675 var isShowed = window.tgpLazyItems.checkGroupShowed(this, function(node) { 676 initFooterWidgetArea.call(node); 677 }); 678 if (!isShowed) { 679 return; 680 } 681 } 682 683 var self = this; 684 $(self).thegemPreloader(function() { 685 $(self).thegem_isotope({ 686 itemSelector: '.widget', 687 layoutMode: 'masonry' 688 }); 689 }); 690 }; 691 692 $('#colophon .footer-widget-area').each(initFooterWidgetArea); 693 694 $('body').updateTabs(); 695 }); 696 697 $(document).on('show.vc.accordion', '[data-vc-accordion]', function() { 698 var $target = $(this).data('vc.accordion').getContainer(); 699 var correction = 0; 700 if(!$target.find('.vc_tta-tabs').length || !$(this).is(':visible') || $target.data('vc-tta-autoplay')) return ; 701 if($('#site-header.animated-header').length && $('#site-header').hasClass('fixed')) { 702 var shrink = $('#site-header').hasClass('shrink'); 703 $('#site-header').addClass('scroll-counting'); 704 $('#site-header').addClass('fixed shrink'); 705 correction = $('#site-header').outerHeight() + $('#site-header').position().top; 706 if(!shrink) { 707 $('#site-header').removeClass('fixed shrink'); 708 } 709 $('#site-header').removeClass('scroll-counting'); 710 } 711 var target_top = $target.offset().top - correction - 100 + 1; 712 $('html, body').stop(true, true).animate({scrollTop:target_top}, 500, 'easeInOutCubic'); 713 }); 714 715 var vc_update_fullwidth_init = true; 716 $(document).on('vc-full-width-row', function(e) { 717 if (window.gemOptions.clientWidth - $page.width() > 25 || window.gemSettings.isRTL) { 718 for (var i = 1; i < arguments.length; i++) { 719 var $el = $(arguments[i]); 720 $el.addClass("vc_hidden"); 721 var $el_full = $el.next(".vc_row-full-width"); 722 $el_full.length || ($el_full = $el.parent().next(".vc_row-full-width")); 723 var el_margin_left = parseInt($el.css("margin-left"), 10), 724 el_margin_right = parseInt($el.css("margin-right"), 10), 725 offset = 0 - $el_full.offset().left - el_margin_left + $('#page').offset().left + parseInt($('#page').css('padding-left')), 726 width = $('#page').width(); 727 728 var offsetKey = window.gemSettings.isRTL ? 'right' : 'left'; 729 var cssData = { 730 position: "relative", 731 left: offset, 732 "box-sizing": "border-box", 733 width: $("#page").width() 734 }; 735 cssData[offsetKey] = offset; 736 737 if ($el.css(cssData), !$el.data("vcStretchContent")) { 738 var padding = -1 * offset; 739 0 > padding && (padding = 0); 740 var paddingRight = width - padding - $el_full.width() + el_margin_left + el_margin_right; 741 0 > paddingRight && (paddingRight = 0), $el.css({ 742 "padding-left": padding + "px", 743 "padding-right": paddingRight + "px" 744 }) 745 } 746 $el.attr("data-vc-full-width-init", "true"), $el.removeClass("vc_hidden"); 747 $el.trigger('VCRowFullwidthUpdate'); 748 } 749 } 750 update_fullwidths(true, vc_update_fullwidth_init); 751 vc_update_fullwidth_init = false;
752 }); 753 754 $('body').on('click', '.gem-button[href^="#give-form-"]', function(e) { 755 var form_id = $(this).attr('href').replace('#give-form-', ''); 756 form_id = parseInt(form_id); 757 if (!isNaN(form_id)) { 758 $('#give-form-' + form_id + ' .give-btn-modal').click(); 759 } 760 e.preventDefault(); 761 return false; 762 }); 763 764 $('body').on('click', '.close-fancybox', function (e){ 765 if (parent.jQuery.fancybox.getInstance()) { 766 e.preventDefault(); 767 parent.jQuery.fancybox.getInstance().close(); 768 } 769 }); 770 771})(jQuery); 772 773// Ajax Notification Hidden Sidebar 774(function($) { 775 776 $('body.notification-hidden-sidebar').on('added_to_cart', function () { 777 $('.thegem-popup-notification-wrap > .thegem-popup-notification.cart').remove(); 778 779 $('body').addClass('notification-locked'); 780 $('.thegem-popup-notification-sidebar').addClass('active'); 781 782 setTimeout(() => { 783 $.fancybox.close(); 784 }, 200) 785 }); 786 787 $('body.notification-hidden-sidebar').on('click touchend', '.thegem-popup-notification-sidebar .close', function (e) { 788 $('.thegem-popup-notification-sidebar').removeClass('active'); 789 $('body').removeClass('notification-locked'); 790 }); 791 792 $('body.notification-hidden-sidebar').on('click touchend', '.thegem-popup-notification-sidebar', function (e) { 793 const wrap = $('.thegem-popup-notification-sidebar .notification-sidebar'); 794 if (!wrap.is(e.target) && wrap.has(e.target).length === 0) { 795 $('.thegem-popup-notification-sidebar').removeClass('active'); 796 $('body').removeClass('notification-locked'); 797 } 798 }); 799 800 $('body.notification-hidden-sidebar').on('click touchend', 'a.minicart-menu-link', function (e) { 801 e.preventDefault(); 802 803 $('body').addClass('notification-locked'); 804 $('.thegem-popup-notification-sidebar').addClass('active'); 805 }); 806 807 $('body.notification-hidden-sidebar').on('click', '.woocommerce-mini-cart-item__qty > .plus, .woocommerce-mini-cart-item__qty > .minus', function () { 808 // Get values 809 var $qty = $(this).closest('.woocommerce-mini-cart-item__qty').find('.qty'), 810 currentVal = parseFloat($qty.val()), 811 max = parseFloat($qty.attr('max')), 812 min = parseFloat($qty.attr('min')), 813 step = $qty.attr('step'); 814 815 // Format values 816 if (!currentVal || currentVal === '' || currentVal === 'NaN') currentVal = 0; 817 if (max === '' || max === 'NaN') max = ''; 818 if (min === '' || min === 'NaN') min = 0; 819 if (step === 'any' || step === '' || step === undefined || parseFloat(step) === 'NaN') step = 1; 820 821 // Change the value 822 if ($(this).is('.plus')) { 823 if (max && (max == currentVal || currentVal > max)) { 824 $qty.val(max); 825 } else { 826 $qty.val(currentVal + parseFloat(step)); 827 } 828 } else { 829 if (min && (min == currentVal || currentVal < min)) { 830 $qty.val(min); 831 } else if (currentVal > 0) { 832 $qty.val(currentVal - parseFloat(step)); 833 } 834 } 835 $qty.trigger('change'); 836 }); 837 838 $('body.notification-hidden-sidebar').on('change input', '.woocommerce-mini-cart .quantity .qty', function () { 839 var input = $(this); 840 var qtyVal = input.val(); 841 var itemID = input.parents('.woocommerce-mini-cart-item').data('key'); 842 843 clearTimeout(window.thegem_cart_update); 844 845 window.thegem_cart_update = setTimeout(function() { 846 $.ajax({ 847 url: woocommerce_params.ajax_url, 848 data: { 849 action: 'thegem_notification_sidebar_update_cart_item', 850 item_id: itemID, 851 qty: qtyVal 852 }, 853 success: function (data) { 854 if (data && data.fragments) { 855 $.each(data.fragments, function (key, value) { 856 if ($(key).hasClass('widget_shopping_cart_content')) { 857 const dataItemValue = $(value).find('.woocommerce-mini-cart-item[data-key="' + itemID + '"]'); 858 const dataFooterValue = $(value).find('.woocommerce-mini-cart__subtotal'); 859 const $itemSelector = $(key).find('.woocommerce-mini-cart-item[data-key="' + itemID + '"]'); 860 861 if (!data.cart_hash) { 862 $(key).replaceWith(value); 863 } else { 864 $itemSelector.replaceWith(dataItemValue); 865 $('.woocommerce-mini-cart__subtotal').replaceWith(dataFooterValue); 866 } 867 } else { 868 $(key).replaceWith(value); 869 } 870 }); 871 } 872 }, 873 dataType: 'json', 874 method: 'GET' 875 }); 876 }, 500); 877 }); 878})(jQuery); 879 880(function($) { 881 $(window).on( 'elementor/frontend/init', function() { 882 elementorFrontend.on( 'components:init', function() { 883 if(typeof elementorFrontend.utils.anchors !== 'undefined') { 884 elementorFrontend.elements.$document.off( 885 'click', 886 elementorFrontend.utils.anchors.getSettings('selectors.links'), 887 elementorFrontend.utils.anchors.handleAnchorLinks 888 ); 889 } 890 if(typeof elementorFrontend.utils.anchor_scroll_margin !== 'undefined') { 891 elementorFrontend.utils.anchor_scroll_margin.setSettings( 'selectors.links', '.elementor-element.elementor-widget:not([data-widget_type*="thegem"]) a[href*="#"]' ); 892 } 893 }); 894 }); 895})(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.