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 extra_margin = parseInt($prevElement.css('margin-left')); 117 if ($prevElement.length == 0 || $prevElement.hasClass('fullwidth-block') || $prevElement.is('style')) { 118 $prevElement = $item.parent(); 119 extra_padding = parseInt($prevElement.css('padding-left')); 120 extra_margin = 0; 121 } 122 123 var offsetKey = window.gemSettings.isRTL ? 'right' : 'left'; 124 var cssData = { 125 width: pageWidth 126 }; 127 cssData[offsetKey] = pageOffset.left - ($prevElement.length ? $prevElement.offset().left - extra_margin : 0) + parseInt(pagePaddingLeft) - extra_padding; 128 129 $item.css(cssData); 130 131 if (!skipTrigger) { 132 fullwidth_block_after_update($item); 133 } 134 } 135 136 var inlineFullwidths = [], 137 notInlineFullwidths = []; 138 139 $('.fullwidth-block').each(function() { 140 var $item = $(this), 141 $parents = $item.parents('.vc_row'), 142 fullw = { 143 isInline: false 144 }; 145 146 $parents.each(function() { 147 if (this.hasAttribute('data-vc-full-width')) { 148 fullw.isInline = true; 149 return false;
150 } 151 }); 152 153 if (fullw.isInline) { 154 inlineFullwidths.push(this); 155 } else { 156 notInlineFullwidths.push(this); 157 } 158 }); 159 160 function update_fullwidths(inline, init) { 161 var $needUpdate = []; 162 163 (inline ? inlineFullwidths : notInlineFullwidths).forEach(function(item) { 164 $needUpdate.push(item); 165 }); 166 167 if ($needUpdate.length > 0) { 168 var pageOffset = $page.offset(), 169 pagePaddingLeft = $page.css('padding-left'), 170 pageWidth = $page.width(); 171 172 $needUpdate.forEach(function(item) { 173 fullwidth_block_update($(item), pageOffset, pagePaddingLeft, pageWidth); 174 }); 175 } 176 } 177 178 if (!window.disableGemSlideshowPreloaderHandle) { 179 jQuery('.gem-slideshow-with-preloader:not(.gem-slideshow-rs)').each(function() { 180 var $slideshow = $(this); 181 $slideshow.thegemPreloader(function() {}); 182 }); 183 } 184 185 var revapi = jQuery(document).ready(function() {}); 186 revapi.one('revolution.slide.onloaded', function() { 187 jQuery('.gem-slideshow').prev('.slideshow-preloader').remove(); 188 }); 189 190 $(function() { 191 $('#gem-icons-loading-hide').remove(); 192 193 if (window.tgpLazyItems===undefined) { 194 $('#thegem-preloader-inline-css').remove(); 195 } 196 197 /*jQuery('iframe').not('.gem-video-background iframe, .wcppec-checkout-buttons iframe').each(function() { 198 $(this).thegemPreloader(function() {}); 199 });*/ 200 201 jQuery('.gem-video-background').each(function() { 202 var $videoBG = $(this); 203 var $videoContainer = $('.gem-video-background-inner', this); 204 var ratio = $videoBG.data('aspect-ratio') ? $videoBG.data('aspect-ratio') : '16:9'; 205 var regexp = /(\d+):(\d+)/; 206 var $fullwidth = $videoBG.closest('.fullwidth-block'); 207 ratio = regexp.exec(ratio); 208 if(!ratio || parseInt(ratio[1]) == 0 || parseInt(ratio[2]) == 0) { 209 ratio = 16/9; 210 } else { 211 ratio = parseInt(ratio[1])/parseInt(ratio[2]); 212 } 213 214 function gemVideoUpdate() { 215 $videoContainer.removeAttr('style'); 216 if($videoContainer.width() / $videoContainer.height() > ratio) { 217 $videoContainer.css({ 218 height: ($videoContainer.width() / ratio) + 'px', 219 marginTop: -($videoContainer.width() / ratio - $videoBG.height()) / 2 + 'px' 220 }); 221 } else { 222 $videoContainer.css({ 223 width: ($videoContainer.height() * ratio) + 'px', 224 marginLeft: -($videoContainer.height() * ratio - $videoBG.width()) / 2 + 'px' 225 }); 226 } 227 } 228 229 if ($videoBG.closest('.vc_row_custom_video_background').length > 0) { 230 gemVideoUpdate(); 231 } 232 233 if ($videoBG.closest('.page-title-block').length > 0) { 234 gemVideoUpdate(); 235 } 236 237 if ($fullwidth.length) { 238 $fullwidth.on('fullwidthUpdate', gemVideoUpdate); 239 } else { 240 $(window).resize(gemVideoUpdate); 241 } 242 }); 243 244 update_fullwidths(false, true); 245 246 247 $('.fullwidth-block').each(function() { 248 var $item = $(this), 249 mobile_enabled = $item.data('mobile-parallax-enable') || '0', 250 is_custom_title = $item.hasClass('custom-title-background'); 251 252 if (!window.gemSettings.isTouch || mobile_enabled == '1') { 253 if ($item.hasClass('fullwidth-block-parallax-vertical')) { 254 var parallaxOptions = {}; 255 if (is_custom_title) { 256 parallaxOptions.position = 'top'; 257 } 258 259 $('.fullwidth-block-background', $item).each(function() { 260 var backgroundImageCss = $(this).css('background-image') || ''; 261 262 if (backgroundImageCss == 'none' || backgroundImageCss == '') { 263 $(this).on('tgpliVisible', function() { 264 $(this).parallaxVertical('50%', parallaxOptions); 265 }); 266 267 return; 268 } 269 270 $(this).parallaxVertical('50%', parallaxOptions); 271 }); 272 } else if ($item.hasClass('fullwidth-block-parallax-horizontal')) { 273 $('.fullwidth-block-background', $item).each(function() { 274 if (!window.gemSettings.parallaxDisabled) { 275 var backgroundImageCss = $(this).css('background-image') || ''; 276 277 if (backgroundImageCss == 'none' || backgroundImageCss == '') { 278 $(this).on('tgpliVisible', function() { 279 $(this).parallaxHorizontal(); 280 }); 281 282 return; 283 } 284 285 $(this).parallaxHorizontal(); 286 } 287 }); 288 } 289 } else { 290 $('.fullwidth-block-background', $item).css({ 291 backgroundAttachment: 'scroll' 292 }); 293 } 294 }); 295 296 if(!window.gemSettings.isTouch) { 297 $('.page-title-parallax-background').each(function() { 298 var backgroundImageCss = $(this).css('background-image') || ''; 299 if (backgroundImageCss == 'none' || backgroundImageCss == '') { 300 $(this).on('tgpliVisible', function() { 301 $(this).parallaxVertical('50%', { 302 position: 'top' 303 }); 304 }); 305 return; 306 } 307 308 $(this).parallaxVertical('50%', { 309 position: 'top' 310 }); 311 }); 312 } else { 313 $('.page-title-parallax-background').css({ 314 backgroundAttachment: 'scroll' 315 }); 316 } 317 318 319 320 $(window).resize(function() { 321 update_fullwidths(false, false); 322 }); 323 324 $(window).on('load', function() { 325 update_fullwidths(false, false); 326 }); 327 328 jQuery('select.gem-combobox, .gem-combobox select, .widget_archive select').each(function(index) { 329 $(this).combobox(); 330 }); 331 332 jQuery('.widget_categories select').each(function() { 333 this.onchange = null; 334 $(this).on('change', function() { 335 if($(this).val() != -1) { 336 $(this).closest('form').submit(); 337 } 338 }); 339 }); 340 341 jQuery('input.gem-checkbox, .gem-checkbox input').each(function(index) { 342 $(this).checkbox(); 343 }); 344 345 if (typeof($.fn.ReStable) == "function") { 346 jQuery('.gem-table-responsive').each(function(index) { 347 $('> table', this).ReStable({ 348 maxWidth: 768, 349 rowHeaders : $(this).hasClass('row-headers') 350 }); 351 }); 352 } 353 354 jQuery('.fancybox').each(function() { 355 $(this).fancybox(); 356 }); 357 358 if (typeof jQuery.fn.scSticky === 'function') { 359 jQuery('.panel-sidebar-sticky > .sidebar').scSticky(); 360 } 361 362 $('.primary-navigation a.mega-no-link').closest('li').removeClass('menu-item-active current-menu-item'); 363 364 function getElementPagePosition(element) { 365 var width = element.offsetWidth, 366 height = element.offsetHeight, 367 left = 0, 368 top = 0; 369
370 while (element && element.id != 'page') { 371 left += element.offsetLeft; 372 top += element.offsetTop; 373 element = element.offsetParent; 374 } 375 376 return {"left": left, "top": top, "width": width, "height": height}; 377 } 378 379 var $anhorsElements = []; 380 $('a[href*="#"]').not('[data-vc-accordion], [data-vc-tabs], .scroll-to-content, .disable-scroll-to-anchor, .disable-scroll-to-anchor a').each(function(e) { 381 var $anhor = $(this); 382 var link = $anhor.attr('href'); 383 if(!link) return ; 384 link = link.split('#'); 385 var currentUrl = window.location.href.split('#')[0]; 386 if(link[0] !== '' && link[0] !== currentUrl) return ; 387 try { 388 if($('#'+link[1]).hasClass('vc_tta-panel')) return ; 389 if($('#'+link[1]).length) { 390 $anhor.closest('li').removeClass('menu-item-active current-menu-item'); 391 $anhor.closest('li').parents('li').removeClass('menu-item-current'); 392 $(document).on('update-page-scroller', function(e, elem) { 393 var $elem = $(elem); 394 if(!$anhor.closest('li.menu-item').length) return ; 395 if($elem.is($('#'+link[1])) || $elem.find($('#'+link[1])).length) { 396 $anhor.closest('li').addClass('menu-item-active'); 397 $anhor.closest('li').parents('li').addClass('menu-item-current'); 398 } else { 399 $anhor.closest('li').removeClass('menu-item-active'); 400 $anhor.closest('li').parents('li.menu-item-current').each(function() { 401 if(!$('.menu-item-active', this).length) { 402 $(this).removeClass('menu-item-current'); 403 } 404 }); 405 } 406 }); 407 $anhor.click(function(e) { 408 e.preventDefault(); 409 history.replaceState('data to be passed', $anhor.text(), $anhor.attr('href')); 410 var correction = 0; 411 var isPerspectiveMenu = $('#thegem-perspective.modalview').length; 412 413 if($('#site-header.animated-header').length) { 414 var shrink = $('#site-header').hasClass('shrink'); 415 $('#site-header').addClass('scroll-counting'); 416 $('#site-header').addClass('fixed shrink'); 417 correction = $('#site-header').outerHeight(); 418 if (!isPerspectiveMenu) { 419 var siteHeaderTop = $('#site-header').position().top; 420 if ($('#site-header').hasClass('shrink')) { 421 siteHeaderTop = 0; 422 } 423 correction += siteHeaderTop; 424 } 425 426 if(!shrink) { 427 $('#site-header').removeClass('fixed shrink'); 428 } 429 setTimeout(function() { 430 $('#site-header').removeClass('scroll-counting'); 431 }, 50); 432 } 433 if($('#site-header.header-sticky').length && $('.header-sticky-template').length) { 434 correction = $('.header-sticky-template').outerHeight(); 435 } 436 var target_top = getElementPagePosition( $('#'+link[1])[0] ).top - correction + 1; 437 if(getElementPagePosition( $('#'+link[1])[0] ).top == 0) { target_top = 0; } 438 if($('body').hasClass('page-scroller') && $('.page-scroller-nav-pane').is(':visible')) { 439 var $block = $('#'+link[1]+'.scroller-block').add($('#'+link[1]).closest('.scroller-block')).eq(0); 440 if($block.length) { 441 $('.page-scroller-nav-pane .page-scroller-nav-item').eq($('.scroller-block').index($block)).trigger('click'); 442 } 443 if($anhor.closest('.overlay-menu-wrapper').length && $anhor.closest('.overlay-menu-wrapper').hasClass('active')) { 444 if($anhor.closest('#primary-navigation').length && $anhor.closest('#primary-navigation').hasClass('responsive')) { 445 $anhor.closest('.thegem-te-menu').find('.menu-toggle').trigger('click'); 446 $anhor.closest('#primary-navigation').find('.menu-toggle').trigger('click'); 447 } else { 448 $anhor.closest('.thegem-te-menu').find('.overlay-toggle').trigger('click'); 449 $anhor.closest('#primary-navigation').find('.overlay-toggle').trigger('click'); 450 } 451 } 452 } else { 453 if (isPerspectiveMenu) { 454 $('#page').stop(true, true).animate({scrollTop:target_top}, 1500, 'easeInOutCubic', function() { 455 if($anhor.closest('#thegem-perspective').length && $anhor.closest('#thegem-perspective').hasClass('modalview')) { 456 $anhor.closest('.thegem-te-menu').find('.perspective-menu-close').trigger('click'); 457 $anhor.closest('#primary-navigation').find('.perspective-menu-close').trigger('click'); 458 } 459 }); 460 } else { 461 $('html, body').stop(true, true).animate({scrollTop:target_top}, 1500, 'easeInOutCubic'); 462 } 463 if($anhor.closest('#primary-menu').length && $anhor.closest('#primary-menu').hasClass('dl-menuopen')) { 464 $anhor.closest('.thegem-te-menu').find('.menu-toggle').trigger('click'); 465 $anhor.closest('#primary-navigation').find('.menu-toggle').trigger('click'); 466 } 467 if($anhor.closest('.mobile-menu-slide-wrapper').length && $anhor.closest('.mobile-menu-slide-wrapper').hasClass('opened')) { 468 $anhor.closest('.thegem-te-menu').find('.mobile-menu-slide-close').trigger('click'); 469 $anhor.closest('#primary-navigation').find('.mobile-menu-slide-close').trigger('click'); 470 } 471 if($anhor.closest('.overlay-menu-wrapper').length && $anhor.closest('.overlay-menu-wrapper').hasClass('active')) { 472 if($anhor.closest('#primary-navigation').length && $anhor.closest('#primary-navigation').hasClass('responsive')) { 473 $anhor.closest('.thegem-te-menu').find('.menu-toggle').trigger('click'); 474 $anhor.closest('#primary-navigation').find('.menu-toggle').trigger('click'); 475 } else { 476 $anhor.closest('.thegem-te-menu').find('.overlay-toggle-close').trigger('click'); 477 $anhor.closest('#primary-navigation').find('.overlay-toggle-close').trigger('click'); 478 } 479 } 480 if($anhor.closest('#primary-navigation').length && $anhor.closest('#primary-navigation').hasClass('hamburger-active')) { 481 $anhor.closest('.thegem-te-menu').find('.hamburger-toggle').trigger('click'); 482 $anhor.closest('#primary-navigation').find('.hamburger-toggle').trigger('click'); 483 } 484 } 485 }); 486 $anhorsElements.push($anhor[0]); 487 } 488 } catch(e) { return; } 489 }); 490 491 if ($anhorsElements.length) { 492 function anchorLinksScroll() { 493 var isPerspectiveMenu = $('#thegem-perspective.modalview').length; 494 var correction = 0; 495 496 if (!$page.hasClass('vertical-header')) { 497 correction = $('#site-header').outerHeight(); 498 if (!isPerspectiveMenu) { 499 var siteHeaderTop = $('#site-header').length ? $('#site-header').position().top : 0; 500 if ($('#site-header').hasClass('shrink')) { 501 siteHeaderTop = 0; 502 } 503 correction += siteHeaderTop; 504 } 505 } 506 507 if($('#site-header.header-sticky').length && $('.header-sticky-template').length) { 508 correction = $('.header-sticky-template').outerHeight(); 509 } 510 511 for (var i = 0; i < $anhorsElements.length; i++) { 512 var $anhor = $($anhorsElements[i]);
513 var link = $anhor.attr('href'); 514 if(!link) continue ; 515 link = link.split('#'); 516 var scrollY = getScrollY() + $page.scrollTop(); 517 518 if(!$anhor.closest('li.menu-item').length) continue ; 519 var target_top = getElementPagePosition( $('#'+link[1])[0] ).top - correction; 520 if(scrollY >= target_top && scrollY <= target_top + $('#'+link[1]).outerHeight()) { 521 $anhor.closest('li').addClass('menu-item-active'); 522 $anhor.closest('li').parents('li').addClass('menu-item-current'); 523 } else { 524 $anhor.closest('li').removeClass('menu-item-active'); 525 $anhor.closest('li').parents('li.menu-item-current').each(function() { 526 if(!$('.menu-item-active', this).length) { 527 $(this).removeClass('menu-item-current'); 528 } 529 }); 530 } 531 } 532 } 533 534 $(window).scroll(anchorLinksScroll); 535 if ($('#thegem-perspective').length) { 536 $page.scroll(anchorLinksScroll); 537 } 538 539 $(window).on('load', function() { 540 for (var i = 0; i < $anhorsElements.length; i++) { 541 var anhor = $anhorsElements[i]; 542 if (anhor.href != undefined && anhor.href && window.location.href == anhor.href) { 543 anhor.click(); 544 break; 545 } 546 } 547 }); 548 } 549 550 $('body').on('click', '.post-footer-sharing .gem-button', function(e) { 551 e.preventDefault(); 552 e.stopPropagation(); 553 $(this).closest('.post-footer-sharing').find('.sharing-popup').addClass('active'); 554 }); 555 556 $('body').on('click', function () { 557 $('.sharing-popup').removeClass('active'); 558 }); 559 560 var scrollTimer, 561 body = document.body; 562 563 $(window).scroll(function() { 564 clearTimeout(scrollTimer); 565 if(!body.classList.contains('disable-hover')) { 566 //body.classList.add('disable-hover') 567 } 568 569 scrollTimer = setTimeout(function(){ 570 //body.classList.remove('disable-hover') 571 }, 300); 572 573 if(getScrollY() > 0) { 574 $('.scroll-top-button').addClass('visible'); 575 } else { 576 $('.scroll-top-button').removeClass('visible'); 577 } 578 }).scroll(); 579 580 function getScrollY(elem){ 581 return window.pageYOffset || document.documentElement.scrollTop; 582 } 583 584 $('a.hidden-email').each(function() { 585 $(this).attr('href', 'mailto:'+$(this).data('name')+'@'+$(this).data('domain')); 586 }); 587 588 var initFooterWidgetArea = function() { 589 if (window.tgpLazyItems !== undefined) { 590 var isShowed = window.tgpLazyItems.checkGroupShowed(this, function(node) { 591 initFooterWidgetArea.call(node); 592 }); 593 if (!isShowed) { 594 return; 595 } 596 } 597 598 var self = this; 599 $(self).thegemPreloader(function() { 600 $(self).thegem_isotope({ 601 itemSelector: '.widget', 602 layoutMode: 'masonry' 603 }); 604 }); 605 }; 606 607 $('#colophon .footer-widget-area').each(initFooterWidgetArea); 608 609 $('body').updateTabs(); 610 }); 611 612 $(document).on('show.vc.accordion', '[data-vc-accordion]', function() { 613 var $target = $(this).data('vc.accordion').getContainer(); 614 var correction = 0; 615 if(!$target.find('.vc_tta-tabs').length || !$(this).is(':visible') || $target.data('vc-tta-autoplay')) return ; 616 if($('#site-header.animated-header').length && $('#site-header').hasClass('fixed')) { 617 var shrink = $('#site-header').hasClass('shrink'); 618 $('#site-header').addClass('scroll-counting'); 619 $('#site-header').addClass('fixed shrink'); 620 correction = $('#site-header').outerHeight() + $('#site-header').position().top; 621 if(!shrink) { 622 $('#site-header').removeClass('fixed shrink'); 623 } 624 $('#site-header').removeClass('scroll-counting'); 625 } 626 var target_top = $target.offset().top - correction - 100 + 1; 627 $('html, body').stop(true, true).animate({scrollTop:target_top}, 500, 'easeInOutCubic'); 628 }); 629 630 var vc_update_fullwidth_init = true; 631 $(document).on('vc-full-width-row', function(e) { 632 if (window.gemOptions.clientWidth - $page.width() > 25 || window.gemSettings.isRTL) { 633 for (var i = 1; i < arguments.length; i++) { 634 var $el = $(arguments[i]); 635 $el.addClass("vc_hidden"); 636 var $el_full = $el.next(".vc_row-full-width"); 637 $el_full.length || ($el_full = $el.parent().next(".vc_row-full-width")); 638 var el_margin_left = parseInt($el.css("margin-left"), 10), 639 el_margin_right = parseInt($el.css("margin-right"), 10), 640 offset = 0 - $el_full.offset().left - el_margin_left + $('#page').offset().left + parseInt($('#page').css('padding-left')), 641 width = $('#page').width(); 642 643 var offsetKey = window.gemSettings.isRTL ? 'right' : 'left'; 644 var cssData = { 645 position: "relative", 646 left: offset, 647 "box-sizing": "border-box", 648 width: $("#page").width() 649 }; 650 cssData[offsetKey] = offset; 651 652 if ($el.css(cssData), !$el.data("vcStretchContent")) { 653 var padding = -1 * offset; 654 0 > padding && (padding = 0); 655 var paddingRight = width - padding - $el_full.width() + el_margin_left + el_margin_right; 656 0 > paddingRight && (paddingRight = 0), $el.css({ 657 "padding-left": padding + "px", 658 "padding-right": paddingRight + "px" 659 }) 660 } 661 $el.attr("data-vc-full-width-init", "true"), $el.removeClass("vc_hidden"); 662 $el.trigger('VCRowFullwidthUpdate'); 663 } 664 } 665 update_fullwidths(true, vc_update_fullwidth_init); 666 vc_update_fullwidth_init = false;
667 }); 668 669 $('body').on('click', '.gem-button[href^="#give-form-"]', function(e) { 670 var form_id = $(this).attr('href').replace('#give-form-', ''); 671 form_id = parseInt(form_id); 672 if (!isNaN(form_id)) { 673 $('#give-form-' + form_id + ' .give-btn-modal').click(); 674 } 675 e.preventDefault(); 676 return false; 677 }); 678 679 $('body').on('click', '.close-fancybox', function (e){ 680 if (parent.jQuery.fancybox.getInstance()) { 681 e.preventDefault(); 682 parent.jQuery.fancybox.getInstance().close(); 683 } 684 }); 685 686})(jQuery); 687 688// Ajax Notification Hidden Sidebar 689(function($) { 690 691 $('body.notification-hidden-sidebar').on('added_to_cart', function () { 692 $('.thegem-popup-notification-wrap > .thegem-popup-notification.cart').remove(); 693 694 $('body').addClass('notification-locked'); 695 $('.thegem-popup-notification-sidebar').addClass('active'); 696 697 setTimeout(() => { 698 $.fancybox.close(); 699 }, 200) 700 }); 701 702 $('body.notification-hidden-sidebar').on('click touchend', '.thegem-popup-notification-sidebar .close', function (e) { 703 $('.thegem-popup-notification-sidebar').removeClass('active'); 704 $('body').removeClass('notification-locked'); 705 }); 706 707 $('body.notification-hidden-sidebar').on('click touchend', '.thegem-popup-notification-sidebar', function (e) { 708 const wrap = $('.thegem-popup-notification-sidebar .notification-sidebar'); 709 if (!wrap.is(e.target) && wrap.has(e.target).length === 0) { 710 $('.thegem-popup-notification-sidebar').removeClass('active'); 711 $('body').removeClass('notification-locked'); 712 } 713 }); 714 715 $('body.notification-hidden-sidebar').on('click touchend', 'a.minicart-menu-link', function (e) { 716 e.preventDefault(); 717 718 $('body').addClass('notification-locked'); 719 $('.thegem-popup-notification-sidebar').addClass('active'); 720 }); 721 722 $('body.notification-hidden-sidebar').on('click', '.woocommerce-mini-cart-item__qty > .plus, .woocommerce-mini-cart-item__qty > .minus', function () { 723 // Get values 724 var $qty = $(this).closest('.woocommerce-mini-cart-item__qty').find('.qty'), 725 currentVal = parseFloat($qty.val()), 726 max = parseFloat($qty.attr('max')), 727 min = parseFloat($qty.attr('min')), 728 step = $qty.attr('step'); 729 730 // Format values 731 if (!currentVal || currentVal === '' || currentVal === 'NaN') currentVal = 0; 732 if (max === '' || max === 'NaN') max = ''; 733 if (min === '' || min === 'NaN') min = 0; 734 if (step === 'any' || step === '' || step === undefined || parseFloat(step) === 'NaN') step = 1; 735 736 // Change the value 737 if ($(this).is('.plus')) { 738 if (max && (max == currentVal || currentVal > max)) { 739 $qty.val(max); 740 } else { 741 $qty.val(currentVal + parseFloat(step)); 742 } 743 } else { 744 if (min && (min == currentVal || currentVal < min)) { 745 $qty.val(min); 746 } else if (currentVal > 0) { 747 $qty.val(currentVal - parseFloat(step)); 748 } 749 } 750 $qty.trigger('change'); 751 }); 752 753 $('body.notification-hidden-sidebar').on('change input', '.woocommerce-mini-cart .quantity .qty', function () { 754 var input = $(this); 755 var qtyVal = input.val(); 756 var itemID = input.parents('.woocommerce-mini-cart-item').data('key'); 757 758 clearTimeout(window.thegem_cart_update); 759 760 window.thegem_cart_update = setTimeout(function() { 761 $.ajax({ 762 url: woocommerce_params.ajax_url, 763 data: { 764 action: 'thegem_notification_sidebar_update_cart_item', 765 item_id: itemID, 766 qty: qtyVal 767 }, 768 success: function (data) { 769 if (data && data.fragments) { 770 $.each(data.fragments, function (key, value) { 771 if ($(key).hasClass('widget_shopping_cart_content')) { 772 const dataItemValue = $(value).find('.woocommerce-mini-cart-item[data-key="' + itemID + '"]'); 773 const dataFooterValue = $(value).find('.woocommerce-mini-cart__subtotal'); 774 const $itemSelector = $(key).find('.woocommerce-mini-cart-item[data-key="' + itemID + '"]'); 775 776 if (!data.cart_hash) { 777 $(key).replaceWith(value); 778 } else { 779 $itemSelector.replaceWith(dataItemValue); 780 $('.woocommerce-mini-cart__subtotal').replaceWith(dataFooterValue); 781 } 782 } else { 783 $(key).replaceWith(value); 784 } 785 }); 786 } 787 }, 788 dataType: 'json', 789 method: 'GET' 790 }); 791 }, 500); 792 }); 793})(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.