1;// Themify Theme Scripts - http://themify.me/ 2 3// Initialize object literals 4var FixedHeader = {}, 5 ThemifyEqualHeight = {}, 6 ThemifyTabs = {}, 7 ThemifyShortest = {}, 8 ThemifySlider = {}, 9 ThemifyVideo = {}, 10 ThemifyParallax = {}; 11 12///////////////////////////////////////////// 13// jQuery functions 14///////////////////////////////////////////// 15(function($){ 16 17 // Test if touch event exists ////////////////////////////// 18 function is_touch_device() { 19 return 'true' == themifyScript.isTouch; 20 } 21 22 // Fixed Header ///////////////////////// 23 FixedHeader = { 24 init: function() { 25 if( '' != themifyScript.fixedHeader ) { 26 var cons = is_touch_device() ? 10 : 74; 27 FixedHeader.headerHeight = $('#headerwrap').height() - cons; 28 this.activate(); 29 $(window).on('scroll touchstart.touchScroll touchmove.touchScroll', this.activate); 30 } else { 31 $('#pagewrap').css('paddingTop', Math.floor( $('#headerwrap').height() )); 32 } 33 }, 34 activate: function() { 35 var $window = $(window), 36 scrollTop = $window.scrollTop(), 37 $h_height = $('#headerwrap').height(); 38 $('#pagewrap').css('paddingTop', Math.floor( $h_height )); 39 if( scrollTop > FixedHeader.headerHeight ) { 40 FixedHeader.scrollEnabled(); 41 } else { 42 FixedHeader.scrollDisabled(); 43 } 44 }, 45 scrollDisabled: function() { 46 $('#headerwrap').removeClass('fixed-header'); 47 $('#header').removeClass('header-on-scroll'); 48 $('body').removeClass('fixed-header-on'); 49 }, 50 scrollEnabled: function() { 51 $('#headerwrap').addClass('fixed-header'); 52 $('#header').addClass('header-on-scroll'); 53 $('body').addClass('fixed-header-on'); 54 } 55 }; 56 57 // Equal height for Content and Sidebar ///////////////////////// 58 ThemifyEqualHeight = { 59 $content: $('#content'), 60 $sidebar: $('#sidebar'), 61 contentMarginTop: 10, 62 smallScreen: 0, 63 resizeRefresh: 0, 64 65 init: function( smallScreen, resizeRefresh ) { 66 this.smallScreen = parseInt( smallScreen, 10 ); 67 this.resizeRefresh = parseInt( resizeRefresh, 10 ); 68 69 this.contentMarginTop = parseInt( this.$content.css( 'margin-top' ).replace(/-/, '').replace(/px/, ''), 10 ); 70 71 var didResize = false; 72 73 if ( ! this.isSmallScreen() ) { 74 this.setHeights(); 75 } 76 77 $(window).resize(function() { 78 didResize = true; 79 }); 80 81 setInterval(function() { 82 if ( didResize ) { 83 didResize = false; 84 if ( ! ThemifyEqualHeight.isSmallScreen() ) { 85 ThemifyEqualHeight.setHeights(); 86 } else { 87 ThemifyEqualHeight.$content.css( 'height', 'auto' ); 88 ThemifyEqualHeight.$sidebar.css( 'height', 'auto' ); 89 } 90 } 91 }, ThemifyEqualHeight.resizeRefresh); 92 }, 93 94 isSmallScreen: function() { 95 return $(window).width() <= this.smallScreen; 96 }, 97 98 setHeights: function() { 99 if ( Math.floor( this.$content.innerHeight() ) - this.contentMarginTop > Math.floor( this.$sidebar.innerHeight() ) ) { 100 this.$sidebar.innerHeight( Math.floor( this.$content.innerHeight() ) ); 101 } else { 102 this.$content.innerHeight( Math.floor( this.$sidebar.innerHeight() ) + this.contentMarginTop ); 103 } 104 } 105 }; 106 107 ThemifyTabs = { 108 init: function( tabset, suffix ) { 109 $( tabset ).each(function(){ 110 var $tabset = $(this); 111 112 $('.htab-link:first', $tabset).addClass('current'); 113 $('.btab-panel:first', $tabset).show(); 114 115 $( $tabset ).on( 'click', '.htab-link', function(e){ 116 e.preventDefault(); 117 118 var $a = $(this), 119 tab = '.' + $a.data('tab') + suffix, 120 $tab = $( tab, $tabset ); 121 122 $( '.htab-link', $tabset ).removeClass('current'); 123 $a.addClass('current'); 124 125 $( '.btab-panel', $tabset ).hide(); 126 $tab.show(); 127 128 $(document.body).trigger( 'themify-tab-switched', $tab ); 129 }); 130 }); 131 } 132 }; 133 134 ThemifyShortest = { 135 init: function($context, area) { 136 this.setShortest( $context, area ); 137 $(window).on('resize', function(){ 138 ThemifyShortest.setShortest( $context, area ); 139 }); 140 }, 141 142 setShortest: function($context, area) { 143 var imgs = $('img', $context), 144 shortestImg = 999999; 145 146 imgs.each(function () { 147 var $img = $(this), 148 imgHeight = $img.outerHeight(); 149 shortestImg = shortestImg <= imgHeight ? shortestImg : imgHeight; 150 }); 151 152 imgs.each(function () { 153 var $img = $(this), 154 imgHeight = $img.outerHeight(); 155 $img.css('marginTop', -Math.abs(imgHeight - shortestImg)/2); 156 }); 157 158 $context.height(shortestImg); 159 if ( 'video' == area ) { 160 $('.slideshow, .caroufredsel_wrapper, .carousel-prev, .carousel-next', $context).height(shortestImg); 161 } else { 162 $('.post-image', $context).height(shortestImg); 163 } 164 } 165 }; 166 167 ThemifySlider = { 168 // Initialize carousels 169 create: function(obj) { 170 obj.each(function() { 171 var $this = $(this ), 172 $sliderWrapper = $this.closest('.loops-wrapper.slider'); 173 // Start Carousel 174 $this.carouFredSel({ 175 responsive : true, 176 prev : function() { 177 if ( ! $sliderWrapper.hasClass('video') ) { 178 return '#' + $this.data('id') + ' .carousel-prev'; 179 } else { 180 $('#' + $this.data('id') + ' .carousel-prev').remove(); 181 } 182 }, 183 next: function() { 184 if ( ! $sliderWrapper.hasClass('video') ) { 185 return '#' + $this.data( 'id' ) + ' .carousel-next'; 186 } else { 187 $('#' + $this.data('id') + ' .carousel-next').remove(); 188 } 189 }, 190 pagination : { 191 container : '#' + $this.data('id') + ' .carousel-pager', 192 anchorBuilder: function( nr, item ) {} 193 }, 194 circular : true, 195 infinite : true, 196 swipe: true, 197 scroll : { 198 items : 1, 199 fx : $this.data('effect'), 200 duration : parseInt($this.data('speed')), 201 onBefore: function() { 202 var pos = $(this).triggerHandler( 'currentPosition' ); 203 $('#' + $this.data('thumbsid') + ' a').removeClass( 'selected' ); 204 $('#' + $this.data('thumbsid') + ' a.itm'+pos).addClass( 'selected' ); 205 var page = Math.floor( pos / 3 ); 206 $('#' + $this.data('thumbsid')).trigger( 'slideToPage', page ); 207 } 208 }, 209 auto : { 210 play : !!('off' != $this.data('autoplay')), 211 timeoutDuration : 'off' != $this.data('autoplay') ? parseInt($this.data('autoplay')) : 0 212 }, 213 items : { 214 visible : { 215 min : 1, 216 max : 1 217 }, 218 width : 222 219 }, 220 onCreate : function() { 221 $this.closest('.slideshow-wrap').css({ 222 'visibility' : 'visible', 223 'height' : 'auto' 224 });
225 $this.closest('.loops-wrapper.slider').css({ 226 'visibility' : 'visible', 227 'height' : 'auto' 228 }); 229 $('.carousel-next, .carousel-prev', $this.closest('.slideshow-wrap')).empty().show(); 230 if ( $sliderWrapper.hasClass('video') ) { 231 ThemifyShortest.init( $this ); 232 } 233 $(window).resize(); 234 $('.slideshow-slider-loader', $this.closest('.slider')).remove(); // remove slider loader 235 } 236 }); 237 // End Carousel 238 239 // Start video slider thumbnails carousel 240 if ( $sliderWrapper.hasClass('video') ) { 241 var $videoPager = $('#' + $this.data('thumbsid')); 242 $('.carousel-nav-wrap', $this.closest('.slideshow-wrap')).remove(); 243 $('a', $videoPager).each(function(i) { 244 $(this).addClass( 'itm'+i ); 245 $(this).click(function() { 246 $this.trigger( 'slideTo', [i, 0, true] ); 247 return false; 248 }); 249 }); 250 $( '.slideshow', $videoPager ).carouFredSel({ 251 direction: 'left', 252 circular: true, 253 responsive: true, 254 infinite: false, 255 align: false, 256 auto: false, 257 items : { 258 visible : { 259 min : 1, 260 max : 4 261 }, 262 width : 250, 263 height: 140 264 }, 265 prev: '#' + $this.data('thumbsid') + ' .carousel-prev', 266 next: '#' + $this.data('thumbsid') + ' .carousel-next', 267 onCreate: function() { 268 $('.slideshow-wrap', $videoPager).css({ 269 'visibility' : 'visible', 270 'height' : 'auto' 271 }); 272 $('.carousel-next, .carousel-prev', $videoPager).empty().show(); 273 } 274 }); 275 // Get shortest image 276 ThemifyShortest.init( $videoPager, 'video' ); 277 } 278 }); 279 }, 280 281 isSmallScreen: function() { 282 return $(window).width() <= 905; 283 }, 284 285 // Initialize carousels 286 createGallery: function(obj) { 287 288 var waitForFinalEvent = (function () { 289 var timers = {}; 290 return function (callback, ms, uniqueId) { 291 if (timers[uniqueId]) { 292 clearTimeout (timers[uniqueId]); 293 } 294 timers[uniqueId] = setTimeout(callback, ms); 295 }; 296 })(); 297 298 $(window).resize(function () { 299 waitForFinalEvent(function(){ 300 obj.each(function() { 301 if ( ThemifySlider.isSmallScreen() ) { 302 $(this).trigger('configuration', { 303 items : { 304 visible : { 305 min : 1, 306 max : 1 307 }, 308 width : 400, 309 height: 'variable' 310 } 311 }, 312 null, 313 true 314 ); 315 $('.type-gallery', $(this)).css({ 316 'opacity': 1, 317 'margin': 0, 318 'left': 'auto' 319 }); 320 $(this).trigger('prev'); 321 } else { 322 $(this).trigger('configuration', { 323 items : { 324 visible : { 325 min : 3, 326 max : 3 327 }, 328 width : 400, 329 height: 'variable' 330 } 331 }, 332 null, 333 true 334 ); 335 $(this).trigger('next'); 336 $(this ).delay(500).trigger('next'); 337 } 338 }); 339 }, 1000, 'themifyuniqueidresize'); 340 }); 341 342 obj.each(function() { 343 var $this = $(this), 344 $sliderWrapper = $this.closest( '.loops-wrapper.slider' ), 345 $builderRow = $this.closest( '.themify_builder_row' ), 346 isFirstColor = 1, 347 thisSpeed = parseInt($this.data('speed'), 10 ), 348 sliderWidth = $sliderWrapper.width(), 349 leftCSS = { 350 'width': Math.floor( sliderWidth / 1.5 ), 351 'marginLeft': 0, 352 'marginRight': -Math.floor( sliderWidth / 2.6 ), 353 'opacity': 0.5 354 }, 355 bigCSS = { 356 'width': Math.floor( sliderWidth / 1.2 ), 357 'marginLeft': -Math.floor( sliderWidth / 5 ), 358 'marginRight': -Math.floor( sliderWidth / 5 ), 359 'opacity': 1 360 }, 361 rightCSS = { 362 'width': Math.floor( sliderWidth / 1.5 ), 363 'marginLeft': 0, 364 'marginRight': 0, 365 'opacity': 0.5 366 }, 367 aniOpts = { 368 queue: false, 369 duration: thisSpeed/1.5 370 }, 371 aniOptsBig = { 372 queue: false, 373 duration: thisSpeed 374 } 375 ; 376 377 $this.carouFredSel({ 378 responsive : true, 379 prev : '#' + $this.data('id') + ' .carousel-prev', 380 next : '#' + $this.data('id') + ' .carousel-next', 381 pagination : { 382 container : '#' + $this.data('id') + ' .carousel-pager' 383 }, 384 circular : true, 385 infinite : true, 386 swipe: true, 387 scroll : { 388 items : 1, 389 fx : 'scroll', 390 duration : thisSpeed, 391 onBefore : function( items ) { 392var oldItems = items.items.old; 393var newItems = items.items.visible; 394 if ( ! ThemifySlider.isSmallScreen() ) { 395 sliderWidth = $sliderWrapper.width();
396 leftCSS = { 397 'width': Math.floor( sliderWidth / 1.5 ), 398 'marginLeft': 0, 399 'marginRight': -Math.floor( sliderWidth / 3 ), 400 'opacity': 0.5 401 }; 402 bigCSS = { 403 'width': Math.floor( sliderWidth / 1.2 ), 404 'marginLeft': -Math.floor( sliderWidth / 4.5 ), 405 'marginRight': -Math.floor( sliderWidth / 5 ), 406 'left': -Math.floor( sliderWidth / 32 ), 407 'opacity': 1 408 }; 409 rightCSS = { 410 'width': Math.floor( sliderWidth / 1.5 ), 411 'marginLeft': 0, 412 'marginRight': 0, 413 'opacity': 0.5 414 }; 415 416 newItems.eq(0) 417 .addClass('gallerySlide') 418 .removeClass('galleryBigSlide') 419 .animate(leftCSS, aniOpts); 420 421 newItems.eq(1) 422 .addClass('galleryBigSlide') 423 .removeClass('gallerySlide') 424 .animate(bigCSS, aniOptsBig); 425 426 newItems.eq(2) 427 .addClass('gallerySlide') 428 .removeClass('galleryBigSlide') 429 .animate(rightCSS, aniOpts); 430 } 431 432 }, 433 onAfter : function( items ) { 434 var newItems = items.items.visible; 435 var $first = $('.post-image img', newItems.filter(':visible').eq(1)); 436 $sliderWrapper.css( 'background-color', $first.data('color') ); 437 $builderRow.css( 'background-color', $first.data('color') ); 438 } 439 }, 440 auto : { 441 play : !!('off' != $this.data('autoplay')), 442 timeoutDuration : 'off' != $this.data('autoplay') ? parseInt($this.data('autoplay')) : 0 443 }, 444 items : { 445 visible : { 446 min : ! ThemifySlider.isSmallScreen() ? 3 : 1, 447 max : ! ThemifySlider.isSmallScreen() ? 3 : 1 448 }, 449 width : 400, 450 height: 'variable' 451 }, 452 onCreate : function(items) { 453 items = items.items; 454 if ( ! ThemifySlider.isSmallScreen() ) { 455 items.addClass('gallerySlide').removeClass('galleryBigSlide').css({ 456 'width': '', 457 'marginLeft': '', 458 'marginRight': '' 459 }); 460 461 items.eq(0).animate(leftCSS, aniOpts); 462 463 items.eq(1).addClass('galleryBigSlide').removeClass('gallerySlide').animate(bigCSS, aniOptsBig); 464 465 items.eq(2).animate(rightCSS, aniOpts); 466 } 467 $( '.post-image img', $this ).each(function(){ 468 var $img = $(this), 469 src = $img.attr('src' ), 470 imageURL = ''; 471 if ( src.match(/(img\.php)/) ) { 472 src = src.split('?src='); 473 src = src[1].split('&'); 474 imageURL = src[0]; 475 } else { 476 imageURL = src; 477 } 478 RGBaster.colors( imageURL, function(data){ 479 $img.attr('data-color', data.dominant); 480 481 if ( 0 == isFirstColor && 'undefined' != typeof data.dominant ) { 482 isFirstColor = false; 483 $sliderWrapper.css( 'background-color', data.dominant ); 484 $builderRow.css( 'background-color', data.dominant ); 485 } 486 isFirstColor--; 487 }); 488 }); 489 490 $this.closest('.slideshow-wrap').css({ 491 'visibility' : 'visible', 492 'height' : 'auto' 493 }); 494 $this.closest('.loops-wrapper.slider').css({ 495 'visibility' : 'visible', 496 'height' : 'auto' 497 }); 498 $('.carousel-next, .carousel-prev', $this.closest('.slideshow-wrap')).empty().show(); 499 $('.carousel-pager', $this.closest('.slideshow-wrap')).remove(); 500 $(window).resize(); 501 $('.slideshow-slider-loader', $this.closest('.slider')).remove(); // remove slider loader 502 } 503 }); 504 }); 505 } 506 }; 507 508 509 ThemifyVideo = { 510 video: [], 511 didResize: false, 512 ratio: themifyScript.videoRatio, 513 514 init: function( $object ) { 515 $object.on('loadeddata', function(e){ 516 var $video = $(this), 517 height = Math.floor( $video.width() / ThemifyVideo.ratio ), 518 css = 'width: 100%; height: ' + height + 'px !important;'; 519 520 $video.css( 'cssText', css); 521 $video.closest('.mejs-container').css( 'cssText', css ); 522 523 $('.mejs-layer', $video.closest('.mejs-inner') ).each(function(){ 524 var $el = $(this); 525 $el.attr( 'style', $el.attr('style').replace(/height:(.*?);/, 'height:' + height + 'px !important;') ); 526 }); 527 528 ThemifyVideo.video['#'+$video.attr('id')] = $video; 529 }); 530 531 this.setHeight(); 532 533 }, 534 535 onResize: function ( c, t ) { 536 onresize = function () { 537 clearTimeout( t ); 538 t = setTimeout( c, 100 ); 539 }; 540 return c; 541 }, 542 543 setHeight: function() { 544 545 this.onResize(function(){ 546 547 for( var object in ThemifyVideo.video ) { 548 var $video = ThemifyVideo.video[object], 549 height = Math.floor( $video.width() / ThemifyVideo.ratio ), 550 css = 'width: 100%; height: ' + height + 'px !important;'; 551 552 $video.css( 'cssText', css); 553 $video.closest('.mejs-container').css( 'cssText', css ); 554 555 $('.mejs-layer', $video.closest('.mejs-inner') ).each(function(){ 556 var $el = $(this); 557 $el.attr( 'style', $el.attr('style').replace(/height:(.*?);/, 'height:' + height + 'px !important;') ); 558 });
559 } 560 561 }); 562 } 563 }; 564 565 ThemifyParallax = { 566 init: function(){ 567 this.sliderWrapper = ['.single #pagewrap .featured-area']; 568 this.lastScrollPoint = 0; 569 570 if(!themifyScript.parallaxHeader) return; 571 this.onLoaded(); 572 }, 573 574 onLoaded: function(){ 575 var self = ThemifyParallax, resizeId; 576 $('body').addClass('parallax-header'); 577 578 $.each(self.sliderWrapper, function(i,v){ 579 if($(v).length > 0) { 580 var $layoutWrap = $('#layout' ), 581 $h_height = $('#headerwrap').height(), 582 $ab = $('#wpadminbar'); 583 if ( $ab.length > 0 ) { 584 $h_height += $ab.height(); 585 } 586 $layoutWrap.css('marginTop', $(v).height() ); 587 $(v).css('top', $h_height); 588 589 $(window).on('scroll', function(){ 590 self.transition(v); 591 }).on('touchmove.touchScroll', function(){ 592 self.transition(v); 593 }).on('resize', function(){ 594 clearTimeout(resizeId); 595 resizeId = setTimeout(function(){ 596 $layoutWrap.css('marginTop', $(v).height() ); 597 $h_height = $('#headerwrap').height(); 598 $ab = $('#wpadminbar'); 599 if ( $ab.length > 0 ) { 600 $h_height += $ab.height(); 601 } 602 $(v).css('top', $h_height); 603 }, 500); 604 }).on('orientationchange', function(){ 605 self.transition(v); 606 }); 607 } 608 }); 609 610 setTimeout(function(){ 611 $(window).resize(); 612 }, 500); 613 }, 614 615 transition: function(obj){ 616 var $obj = $(obj), $window = $(window), item_h = Math.ceil( $obj.find('.item').first().height() / 2 ), 617 scrollTop = $window.scrollTop(), 618 activePoint = Math.ceil($obj.height() - item_h ), n; 619 620 if ( scrollTop > activePoint ) { 621 n = Math.ceil( scrollTop + (this.lastScrollPoint - scrollTop) / 2); 622 } else { 623 n = Math.ceil(scrollTop); 624 this.lastScrollPoint = scrollTop; 625 } 626 $obj.css({ 627 '-webkit-transform' : 'translateY(-'+n+'px)', 628 '-moz-transform' : 'translateY(-'+n+'px)', 629 '-o-transform' : 'translateY(-'+n+'px)', 630 '-ms-transform' : 'translateY(-'+n+'px)', 631 'transform' : 'translateY(-'+n+'px)' 632 }); 633 } 634 }; 635 636 function addSocialButtons($context){ 637 if( typeof $context === 'undefined' ) $context = $('#content'); 638 // Social share 639 if( $('.post-share', $context).length > 0 ){ 640 641 $('.post-share', $context).each(function(){ 642 643 var $self = $(this ), 644 dataURL = $self.attr('data-url' ), 645 dataMedia = $self.attr('data-media' ), 646 dataDescription = $self.attr('data-description'); 647 648 $self.sharrre({ 649 share: { 650 twitter: true, 651 facebook: true, 652 googlePlus: true, 653 pinterest: true 654 }, 655 template: themifyScript.sharehtml, 656 enableHover: false, 657 render: function(api, options){ 658 659 $('.twitter-share .count', $(api.element) ).text(api.options.count.twitter); 660 $('.facebook-share .count', $(api.element) ).text(api.options.count.facebook); 661 $('.pinterest-share .count', $(api.element) ).text(api.options.count.pinterest); 662 $('.googleplus-share .count', $(api.element) ).text(api.options.count.googlePlus); 663 664 $(api.element).on('click', '.twitter-share', function(event) { 665 api.openPopup('twitter'); 666 $('.count', $(this) ).text( api.options.count.twitter + 1 ); 667 }); 668 $(api.element).on('click', '.facebook-share', function(event) { 669 api.openPopup('facebook'); 670 $('.count', $(this) ).text( api.options.count.facebook + 1 ); 671 }); 672 $(api.element).on('click', '.pinterest-share', function(event) { 673 api.openPopup('pinterest'); 674 $('.count', $(this) ).text( api.options.count.pinterest + 1 ); 675 }); 676 $(api.element).on('click', '.googleplus-share', function(event) { 677 api.openPopup('googlePlus'); 678 $('.count', $(this) ).text( api.options.count.googlePlus + 1 ); 679 }); 680 }, 681 url: dataURL, 682 urlCurl: themifyScript.sharrrephp, 683 buttons: { 684 pinterest: { 685 url: dataURL, 686 media: dataMedia, 687 description: dataDescription 688 } 689 } 690 }); 691 692 }); 693 } 694 } 695 696// DOCUMENT READY 697$(document).ready(function() { 698 699 var $body = $('body'); 700 701 if ( is_touch_device() ) { 702 $body.addClass('touch'); 703 } 704 705 // Add social buttons /////////////////////// 706 addSocialButtons('#body'); 707 708 // Carousel initialization //////////////////
709 if ( typeof $.fn.carouFredSel !== 'undefined' ) { 710 var carouselInit = function( $context ) { 711 $context = $context || $body; 712 ThemifySlider.create( $( '.loops-wrapper.shortcode.event .slideshow', $context ) ); 713 ThemifySlider.create( $( '.loops-wrapper.shortcode.video .slideshow', $context ) ); 714 ThemifySlider.createGallery( $( '.loops-wrapper.shortcode.gallery .slideshow', $context ) ); 715 }; 716 carouselInit(); 717 // Front Builder 718 $body.on('builder_toggle_frontend', function(event, is_edit){ 719 carouselInit($(this)); 720 }).on('builder_load_module_partial', function(event, $newElems){ 721 carouselInit($newElems); 722 }); 723 724 } 725 726 727 // Set shortest height 728 $('.loops-wrapper.shortcode.video:not(.slider)').each(function(){ 729 ThemifyShortest.init( $(this), 'grids' ); 730 }); 731 732 ///////////////////////////////////////////// 733 // Scroll to top 734 ///////////////////////////////////////////// 735 $('.back-top a').click(function() { 736 $('body,html').animate({ scrollTop: 0 }, 800); 737 return false; 738 }); 739 740 ///////////////////////////////////////////// 741 // Toggle main nav on mobile 742 ///////////////////////////////////////////// 743 if ( $(window).width() < 780 ) { 744 $('#main-nav').addClass('scroll-nav'); 745 } 746 747 // Release spacing taken by mobile menu 748 $( window ).on( 'resize orientationchange', window.UIkit.Utils.debounce(function(){ 749 $.UIkit.offcanvas.hide(); 750 }, 300 ) ); 751 752 $('#menu-icon-close').on('click', function(e){ 753 e.preventDefault(); 754 $.UIkit.offcanvas.hide(); 755 }); 756 757 // Reset slide nav width 758 $(window).resize(function(){ 759 var viewport = $(window).width(); 760 if (viewport > 780) { 761 $body.removeAttr('style'); 762 $('#main-nav').removeClass('scroll-nav'); 763 } else { 764 $('#main-nav').addClass('scroll-nav'); 765 } 766 }); 767 768 if( typeof jQuery.fn.themifyDropdown == 'function' ) { 769 $( '#main-nav' ).themifyDropdown(); 770 } 771 772 // Initialize Tabs for Widget /////////////// 773 ThemifyTabs.init( '.event-posts', '-events' ); 774 775 // Initialize video aspect ratio 776 ThemifyVideo.init( $( 'video.wp-video-shortcode' ) ); 777 778}); 779 780// WINDOW LOAD 781$(window).load(function() { 782 // Lightbox / Fullscreen initialization /////////// 783 if(typeof ThemifyGallery !== 'undefined') { 784 ThemifyGallery.init({'context': $(themifyScript.lightboxContext)}); 785 } 786 787 ///////////////////////////////////////////// 788 // Single Gallery Post Type 789 ///////////////////////////////////////////// 790 if ( $('body.single-gallery').length > 0 && 'undefined' !== typeof $.fn.masonry ) { 791 $('.masonry').masonry({ 792 'columnWidth': '.grid-size', 793 'itemSelector': '.item' 794 }); 795 } 796 797 // Initialize internal Like button //////////////// 798 $(document).on('click', '.likeit', function(e) { 799 e.preventDefault(); 800 var $self = $(this), 801 post_id = $self.data('postid'); 802 $.post( 803 themifyScript.ajax_url, 804 { 805 action: 'themify_likeit', 806 nonce : themifyScript.ajax_nonce, 807 post_id: post_id 808 }, 809 function(response) { 810 data = $.parseJSON(response); 811 if( 'new' == data.status ) { 812 $('.count', $self).fadeOut('slow', function(){ 813 $(this).text(data.likers).fadeIn('slow'); 814 }); 815 $(this).addClass('likeit_done'); 816 } 817 } 818 ); 819 }); 820 821 // Set content and sidebar equal height /////////// 822 ThemifyEqualHeight.init(themifyScript.smallScreen, themifyScript.resizeRefresh); 823 824 // Parallax Header /////////// 825 if ( 'undefined' !== typeof ThemifyParallax ) { 826 ThemifyParallax.init(); 827 } 828 829 // Fixed header ///////////////////////////// 830 FixedHeader.init(); 831}); 832 833})(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.