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 if (typeof jQuery.fn.scSticky === 'function') { 353 jQuery('.panel-sidebar-sticky > .sidebar').scSticky(); 354 } 355 356 if (typeof jQuery.fn.sticky === 'function') { 357 stickyColumns(); 358 359 function stickyColumns() { 360 361 const $header = $('#site-header-wrapper'), 362 headerH = $header.length > 0 ? $header[0].clientHeight : 0, 363 offset = headerH - 1; 364 365 $('.thegem-column-sticky .elementor-column-wrap, .thegem-column-sticky > .elementor-widget-wrap').each(function (){ 366 367 if ($(this).data('sticky')) { 368 $(this).sticky('destroy'); 369 } 370 371 const stickyTo = $(this).parent().data('sticky-to') ? $(this).parent().data('sticky-to') : 'top', 372 stickyOffset = $(this).parent().data('sticky-offset') !== '' ? $(this).parent().data('sticky-offset') : stickyTo === 'bottom' ? 0 : offset; 373 374 $(this).sticky({ 375 to: stickyTo, 376 offset: stickyOffset, 377 effectsOffset: stickyOffset, 378 parent: 'parent', 379 spacerHide: '.elementor-element' 380 }); 381 }); 382 } 383 } 384 385 jQuery('iframe + .map-locker').each(function() { 386 var $locker = $(this); 387 $locker.click(function(e) { 388 e.preventDefault(); 389 if($locker.hasClass('disabled')) { 390 $locker.prev('iframe').css({ 'pointer-events' : 'none' }); 391 } else { 392 $locker.prev('iframe').css({ 'pointer-events' : 'auto' }); 393 } 394 $locker.toggleClass('disabled'); 395 }); 396 }); 397 398 $('.primary-navigation a.mega-no-link').closest('li').removeClass('menu-item-active current-menu-item'); 399 400 function getElementPagePosition(element) { 401 var width = element.offsetWidth, 402 height = element.offsetHeight, 403 left = 0, 404 top = 0; 405
406 while (element && element.id != 'page') { 407 left += element.offsetLeft; 408 top += element.offsetTop; 409 element = element.offsetParent; 410 } 411 412 return {"left": left, "top": top, "width": width, "height": height}; 413 } 414 415 var $anhorsElements = []; 416 $('a[href*="#"]').not('[data-vc-accordion], [data-vc-tabs]').each(function(e) { 417 var $anhor = $(this); 418 var link = $anhor.attr('href'); 419 if(!link) return ; 420 link = link.split('#'); 421 try { 422 if($('#'+link[1]).hasClass('vc_tta-panel')) return ; 423 if($('#'+link[1]).length) { 424 $anhor.closest('li').removeClass('menu-item-active current-menu-item'); 425 $anhor.closest('li').parents('li').removeClass('menu-item-current'); 426 $(document).on('update-page-scroller', function(e, elem) { 427 var $elem = $(elem); 428 if(!$anhor.closest('li.menu-item').length) return ; 429 if($elem.is($('#'+link[1])) || $elem.find($('#'+link[1])).length) { 430 $anhor.closest('li').addClass('menu-item-active'); 431 $anhor.closest('li').parents('li').addClass('menu-item-current'); 432 } else { 433 $anhor.closest('li').removeClass('menu-item-active'); 434 $anhor.closest('li').parents('li.menu-item-current').each(function() { 435 if(!$('.menu-item-active', this).length) { 436 $(this).removeClass('menu-item-current'); 437 } 438 }); 439 } 440 }); 441 $anhor.click(function(e) { 442 e.preventDefault(); 443 history.replaceState('data to be passed', $anhor.text(), $anhor.attr('href')); 444 var correction = 0; 445 var isPerspectiveMenu = $('#thegem-perspective.modalview').length; 446 447 if($('#site-header.animated-header').length) { 448 var shrink = $('#site-header').hasClass('shrink'); 449 $('#site-header').addClass('scroll-counting'); 450 $('#site-header').addClass('fixed shrink'); 451 correction = $('#site-header').outerHeight(); 452 if (!isPerspectiveMenu) { 453 var siteHeaderTop = $('#site-header').position().top; 454 if ($('#site-header').hasClass('shrink')) { 455 siteHeaderTop = 0; 456 } 457 correction += siteHeaderTop; 458 } 459 460 if(!shrink) { 461 $('#site-header').removeClass('fixed shrink'); 462 } 463 setTimeout(function() { 464 $('#site-header').removeClass('scroll-counting'); 465 }, 50); 466 } 467 if($('#site-header.header-sticky').length && $('.header-sticky-template').length) { 468 correction = $('.header-sticky-template').outerHeight(); 469 } 470 var target_top = getElementPagePosition( $('#'+link[1])[0] ).top - correction + 1; 471 if(getElementPagePosition( $('#'+link[1])[0] ).top == 0) { target_top = 0; } 472 if($('body').hasClass('page-scroller') && $('.page-scroller-nav-pane').is(':visible')) { 473 var $block = $('#'+link[1]+'.scroller-block').add($('#'+link[1]).closest('.scroller-block')).eq(0); 474 if($block.length) { 475 $('.page-scroller-nav-pane .page-scroller-nav-item').eq($('.scroller-block').index($block)).trigger('click'); 476 } 477 if($anhor.closest('.overlay-menu-wrapper').length && $anhor.closest('.overlay-menu-wrapper').hasClass('active')) { 478 if($anhor.closest('#primary-navigation').length && $anhor.closest('#primary-navigation').hasClass('responsive')) { 479 $anhor.closest('.thegem-te-menu').find('.menu-toggle').trigger('click'); 480 $anhor.closest('#primary-navigation').find('.menu-toggle').trigger('click'); 481 } else { 482 $anhor.closest('.thegem-te-menu').find('.overlay-toggle').trigger('click'); 483 $anhor.closest('#primary-navigation').find('.overlay-toggle').trigger('click'); 484 } 485 } 486 } else { 487 if (isPerspectiveMenu) { 488 $('#page').stop(true, true).animate({scrollTop:target_top}, 1500, 'easeInOutCubic', function() { 489 if($anhor.closest('#thegem-perspective').length && $anhor.closest('#thegem-perspective').hasClass('modalview')) { 490 $anhor.closest('.thegem-te-menu').find('.perspective-menu-close').trigger('click'); 491 $anhor.closest('#primary-navigation').find('.perspective-menu-close').trigger('click'); 492 } 493 }); 494 } else { 495 $('html, body').stop(true, true).animate({scrollTop:target_top}, 1500, 'easeInOutCubic'); 496 } 497 if($anhor.closest('#primary-menu').length && $anhor.closest('#primary-menu').hasClass('dl-menuopen')) { 498 $anhor.closest('.thegem-te-menu').find('.menu-toggle').trigger('click'); 499 $anhor.closest('#primary-navigation').find('.menu-toggle').trigger('click'); 500 } 501 if($anhor.closest('.mobile-menu-slide-wrapper').length && $anhor.closest('.mobile-menu-slide-wrapper').hasClass('opened')) { 502 $anhor.closest('.thegem-te-menu').find('.mobile-menu-slide-close').trigger('click'); 503 $anhor.closest('#primary-navigation').find('.mobile-menu-slide-close').trigger('click'); 504 } 505 if($anhor.closest('.overlay-menu-wrapper').length && $anhor.closest('.overlay-menu-wrapper').hasClass('active')) { 506 if($anhor.closest('#primary-navigation').length && $anhor.closest('#primary-navigation').hasClass('responsive')) { 507 $anhor.closest('.thegem-te-menu').find('.menu-toggle').trigger('click'); 508 $anhor.closest('#primary-navigation').find('.menu-toggle').trigger('click'); 509 } else { 510 $anhor.closest('.thegem-te-menu').find('.overlay-toggle-close').trigger('click'); 511 $anhor.closest('#primary-navigation').find('.overlay-toggle-close').trigger('click'); 512 } 513 } 514 if($anhor.closest('#primary-navigation').length && $anhor.closest('#primary-navigation').hasClass('hamburger-active')) { 515 $anhor.closest('.thegem-te-menu').find('.hamburger-toggle').trigger('click'); 516 $anhor.closest('#primary-navigation').find('.hamburger-toggle').trigger('click'); 517 } 518 } 519 }); 520 $anhorsElements.push($anhor[0]); 521 } 522 } catch(e) { return; } 523 }); 524 525 if ($anhorsElements.length) { 526 function anchorLinksScroll() { 527 var isPerspectiveMenu = $('#thegem-perspective.modalview').length; 528 var correction = 0; 529 530 if (!$page.hasClass('vertical-header')) { 531 correction = $('#site-header').outerHeight(); 532 if (!isPerspectiveMenu) { 533 var siteHeaderTop = $('#site-header').length ? $('#site-header').position().top : 0; 534 if ($('#site-header').hasClass('shrink')) { 535 siteHeaderTop = 0; 536 } 537 correction += siteHeaderTop; 538 } 539 } 540 541 if($('#site-header.header-sticky').length && $('.header-sticky-template').length) { 542 correction = $('.header-sticky-template').outerHeight(); 543 } 544 545 for (var i = 0; i < $anhorsElements.length; i++) { 546 var $anhor = $($anhorsElements[i]);
547 var link = $anhor.attr('href'); 548 if(!link) continue ; 549 link = link.split('#'); 550 var scrollY = getScrollY() + $page.scrollTop(); 551 552 if(!$anhor.closest('li.menu-item').length) continue ; 553 var target_top = getElementPagePosition( $('#'+link[1])[0] ).top - correction; 554 if(scrollY >= target_top && scrollY <= target_top + $('#'+link[1]).outerHeight()) { 555 $anhor.closest('li').addClass('menu-item-active'); 556 $anhor.closest('li').parents('li').addClass('menu-item-current'); 557 } else { 558 $anhor.closest('li').removeClass('menu-item-active'); 559 $anhor.closest('li').parents('li.menu-item-current').each(function() { 560 if(!$('.menu-item-active', this).length) { 561 $(this).removeClass('menu-item-current'); 562 } 563 }); 564 } 565 } 566 } 567 568 $(window).scroll(anchorLinksScroll); 569 if ($('#thegem-perspective').length) { 570 $page.scroll(anchorLinksScroll); 571 } 572 573 $(window).on('load', function() { 574 for (var i = 0; i < $anhorsElements.length; i++) { 575 var anhor = $anhorsElements[i]; 576 if (anhor.href != undefined && anhor.href && window.location.href == anhor.href) { 577 anhor.click(); 578 break; 579 } 580 } 581 }); 582 } 583 584 $('body').on('click', '.post-footer-sharing .gem-button', function(e) { 585 e.stopPropagation(); 586 e.preventDefault(); 587 $(this).closest('.post-footer-sharing').find('.sharing-popup').toggleClass('active'); 588 }); 589 590 var scrollTimer, 591 body = document.body; 592 593 $(window).scroll(function() { 594 clearTimeout(scrollTimer); 595 if(!body.classList.contains('disable-hover')) { 596 //body.classList.add('disable-hover') 597 } 598 599 scrollTimer = setTimeout(function(){ 600 //body.classList.remove('disable-hover') 601 }, 300); 602 603 if(getScrollY() > 0) { 604 $('.scroll-top-button').addClass('visible'); 605 } else { 606 $('.scroll-top-button').removeClass('visible'); 607 } 608 }).scroll(); 609 610 function getScrollY(elem){ 611 return window.pageYOffset || document.documentElement.scrollTop; 612 } 613 614 $('a.hidden-email').each(function() { 615 $(this).attr('href', 'mailto:'+$(this).data('name')+'@'+$(this).data('domain')); 616 }); 617 618 var initFooterWidgetArea = function() { 619 if (window.tgpLazyItems !== undefined) { 620 var isShowed = window.tgpLazyItems.checkGroupShowed(this, function(node) { 621 initFooterWidgetArea.call(node); 622 }); 623 if (!isShowed) { 624 return; 625 } 626 } 627 628 var self = this; 629 $(self).thegemPreloader(function() { 630 $(self).thegem_isotope({ 631 itemSelector: '.widget', 632 layoutMode: 'masonry' 633 }); 634 }); 635 }; 636 637 $('#colophon .footer-widget-area').each(initFooterWidgetArea); 638 639 $('body').updateTabs(); 640 }); 641 642 $(document).on('show.vc.accordion', '[data-vc-accordion]', function() { 643 var $target = $(this).data('vc.accordion').getContainer(); 644 var correction = 0; 645 if(!$target.find('.vc_tta-tabs').length || !$(this).is(':visible') || $target.data('vc-tta-autoplay')) return ; 646 if($('#site-header.animated-header').length && $('#site-header').hasClass('fixed')) { 647 var shrink = $('#site-header').hasClass('shrink'); 648 $('#site-header').addClass('scroll-counting'); 649 $('#site-header').addClass('fixed shrink'); 650 correction = $('#site-header').outerHeight() + $('#site-header').position().top; 651 if(!shrink) { 652 $('#site-header').removeClass('fixed shrink'); 653 } 654 $('#site-header').removeClass('scroll-counting'); 655 } 656 var target_top = $target.offset().top - correction - 100 + 1; 657 $('html, body').stop(true, true).animate({scrollTop:target_top}, 500, 'easeInOutCubic'); 658 }); 659 660 var vc_update_fullwidth_init = true; 661 $(document).on('vc-full-width-row', function(e) { 662 if (window.gemOptions.clientWidth - $page.width() > 25 || window.gemSettings.isRTL) { 663 for (var i = 1; i < arguments.length; i++) { 664 var $el = $(arguments[i]); 665 $el.addClass("vc_hidden"); 666 var $el_full = $el.next(".vc_row-full-width"); 667 $el_full.length || ($el_full = $el.parent().next(".vc_row-full-width")); 668 var el_margin_left = parseInt($el.css("margin-left"), 10), 669 el_margin_right = parseInt($el.css("margin-right"), 10), 670 offset = 0 - $el_full.offset().left - el_margin_left + $('#page').offset().left + parseInt($('#page').css('padding-left')), 671 width = $('#page').width(); 672 673 var offsetKey = window.gemSettings.isRTL ? 'right' : 'left'; 674 var cssData = { 675 position: "relative", 676 left: offset, 677 "box-sizing": "border-box", 678 width: $("#page").width() 679 }; 680 cssData[offsetKey] = offset; 681 682 if ($el.css(cssData), !$el.data("vcStretchContent")) { 683 var padding = -1 * offset; 684 0 > padding && (padding = 0); 685 var paddingRight = width - padding - $el_full.width() + el_margin_left + el_margin_right; 686 0 > paddingRight && (paddingRight = 0), $el.css({ 687 "padding-left": padding + "px", 688 "padding-right": paddingRight + "px" 689 }) 690 } 691 $el.attr("data-vc-full-width-init", "true"), $el.removeClass("vc_hidden"); 692 $el.trigger('VCRowFullwidthUpdate'); 693 } 694 } 695 update_fullwidths(true, vc_update_fullwidth_init); 696 vc_update_fullwidth_init = false;
697 }); 698 699 $('body').on('click', '.gem-button[href^="#give-form-"]', function(e) { 700 var form_id = $(this).attr('href').replace('#give-form-', ''); 701 form_id = parseInt(form_id); 702 if (!isNaN(form_id)) { 703 $('#give-form-' + form_id + ' .give-btn-modal').click(); 704 } 705 e.preventDefault(); 706 return false; 707 }); 708 709 $('body').on('click', '.close-fancybox', function (e){ 710 if (parent.jQuery.fancybox.getInstance()) { 711 e.preventDefault(); 712 parent.jQuery.fancybox.getInstance().close(); 713 } 714 }); 715 716})(jQuery); 717 718// Ajax Notification Hidden Sidebar 719(function($) { 720 721 $('body.notification-hidden-sidebar').on('added_to_cart', function () { 722 $('.thegem-popup-notification-wrap > .thegem-popup-notification.cart').remove(); 723 724 $('body').addClass('notification-locked'); 725 $('.thegem-popup-notification-sidebar').addClass('active'); 726 727 setTimeout(() => { 728 $.fancybox.close(); 729 }, 200) 730 }); 731 732 $('body.notification-hidden-sidebar').on('click touchend', '.thegem-popup-notification-sidebar .close', function (e) { 733 $('.thegem-popup-notification-sidebar').removeClass('active'); 734 $('body').removeClass('notification-locked'); 735 }); 736 737 $('body.notification-hidden-sidebar').on('click touchend', '.thegem-popup-notification-sidebar', function (e) { 738 const wrap = $('.thegem-popup-notification-sidebar .notification-sidebar'); 739 if (!wrap.is(e.target) && wrap.has(e.target).length === 0) { 740 $('.thegem-popup-notification-sidebar').removeClass('active'); 741 $('body').removeClass('notification-locked'); 742 } 743 }); 744 745 $('body.notification-hidden-sidebar').on('click touchend', 'a.minicart-menu-link', function (e) { 746 e.preventDefault(); 747 748 $('body').addClass('notification-locked'); 749 $('.thegem-popup-notification-sidebar').addClass('active'); 750 }); 751 752 $('body.notification-hidden-sidebar').on('click', '.woocommerce-mini-cart-item__qty > .plus, .woocommerce-mini-cart-item__qty > .minus', function () { 753 // Get values 754 var $qty = $(this).closest('.woocommerce-mini-cart-item__qty').find('.qty'), 755 currentVal = parseFloat($qty.val()), 756 max = parseFloat($qty.attr('max')), 757 min = parseFloat($qty.attr('min')), 758 step = $qty.attr('step'); 759 760 // Format values 761 if (!currentVal || currentVal === '' || currentVal === 'NaN') currentVal = 0; 762 if (max === '' || max === 'NaN') max = ''; 763 if (min === '' || min === 'NaN') min = 0; 764 if (step === 'any' || step === '' || step === undefined || parseFloat(step) === 'NaN') step = 1; 765 766 // Change the value 767 if ($(this).is('.plus')) { 768 if (max && (max == currentVal || currentVal > max)) { 769 $qty.val(max); 770 } else { 771 $qty.val(currentVal + parseFloat(step)); 772 } 773 } else { 774 if (min && (min == currentVal || currentVal < min)) { 775 $qty.val(min); 776 } else if (currentVal > 0) { 777 $qty.val(currentVal - parseFloat(step)); 778 } 779 } 780 $qty.trigger('change'); 781 }); 782 783 $('body.notification-hidden-sidebar').on('change input', '.woocommerce-mini-cart .quantity .qty', function () { 784 var input = $(this); 785 var qtyVal = input.val(); 786 var itemID = input.parents('.woocommerce-mini-cart-item').data('key'); 787 788 clearTimeout(window.thegem_cart_update); 789 790 window.thegem_cart_update = setTimeout(function() { 791 $.ajax({ 792 url: woocommerce_params.ajax_url, 793 data: { 794 action: 'thegem_notification_sidebar_update_cart_item', 795 item_id: itemID, 796 qty: qtyVal 797 }, 798 success: function (data) { 799 if (data && data.fragments) { 800 $.each(data.fragments, function (key, value) { 801 if ($(key).hasClass('widget_shopping_cart_content')) { 802 const dataItemValue = $(value).find('.woocommerce-mini-cart-item[data-key="' + itemID + '"]'); 803 const dataFooterValue = $(value).find('.woocommerce-mini-cart__subtotal'); 804 const $itemSelector = $(key).find('.woocommerce-mini-cart-item[data-key="' + itemID + '"]'); 805 806 if (!data.cart_hash) { 807 $(key).replaceWith(value); 808 } else { 809 $itemSelector.replaceWith(dataItemValue); 810 $('.woocommerce-mini-cart__subtotal').replaceWith(dataFooterValue); 811 } 812 } else { 813 $(key).replaceWith(value); 814 } 815 }); 816 } 817 }, 818 dataType: 'json', 819 method: 'GET' 820 }); 821 }, 500); 822 }); 823})(jQuery); 824 825(function($) { 826 $(window).on( 'elementor/frontend/init', function() { 827 elementorFrontend.on( 'components:init', function() { 828 if(typeof elementorFrontend.utils.anchors !== 'undefined') { 829 elementorFrontend.elements.$document.off( 830 'click', 831 elementorFrontend.utils.anchors.getSettings('selectors.links'), 832 elementorFrontend.utils.anchors.handleAnchorLinks 833 ); 834 } 835 if(typeof elementorFrontend.utils.anchor_scroll_margin !== 'undefined') { 836 elementorFrontend.utils.anchor_scroll_margin.setSettings( 'selectors.links', '.elementor-element.elementor-widget:not([data-widget_type*="thegem"]) a[href*="#"]' ); 837 } 838 }); 839 }); 840})(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.