1( function( $ ) { 2 "use strict"; 3 4 var _defaults = { 5 duration: 500, 6 easing: 'swing', 7 offset: 0, 8 complete: function() {} 9 }; 10 11 function ContentReveal( element, options ) { 12 this.root = $( element ); 13 this.opts = $.extend( _defaults, options ); 14 15 if ( element.hash.length > 1 ) { 16 var target = $( element.hash ); 17 18 if ( target.length > 0 ) { 19 this.target = target; 20 this.root.on( 'click', this.reveal.bind( this ) ); 21 } 22 } 23 }; 24 25 ContentReveal.prototype = { 26 reveal: function( evt ) { 27 evt.preventDefault(); 28 29 $("html, body").animate({ 30 scrollTop: this.target.offset().top - this.opts.offset 31 }, 500, ( function( evt ) { 32 if ( $.isFunction( this.opts.complete ) ) 33 this.opts.complete.call( this, evt ); 34 } ).bind( this ) ); 35 } 36 }; 37 38 $.fn.contentReveal = function( options ) { 39 return this.each( function() { 40 $( this ).data( '_contentReveal', new ContentReveal( this, options ) ); 41 } ); 42 } 43 44} ).call( this, jQuery ); 45( function( $ ) { 46 "use strict"; 47 48 var doc = $( document ); 49 50 function NavSearch( element ) { 51 this.element = $( element ); 52 this.toggler = $( '> a:first-child', this.element ); 53 this.input = $( 'input', this.element ); 54 55 doc.on( 'click', this.hide.bind( this ) ); 56 this.toggler.on( 'click', this.toggle.bind( this ) ); 57 this.element.on( 'click', function( e ) { 58 e.stopPropagation(); 59 }); 60 this.element.on( 'keydown', ( function( e ) { 61 if ( e.keyCode == 27 ) 62 this.hide(); 63 } ).bind( this ) ); 64 65 $.each( ['transitionend', 'oTransitionEnd', 'webkitTransitionEnd'], ( function( index, eventName ) { 66 $( '> .submenu', this.element ).on( eventName, ( function() { 67 if ( this.element.hasClass( 'active' ) ) 68 this.input.get( 0 ).focus(); 69 } ).bind( this ) ); 70 } ).bind( this ) ); 71 }; 72 73 NavSearch.prototype = { 74 toggle: function( e ) { 75 e.preventDefault(); 76 e.stopPropagation(); 77 78 this.element.toggleClass( 'active' ); 79 }, 80 81 hide: function() { 82 this.element.removeClass( 'active' ); 83 } 84 }; 85 86 $.fn.navSearch = function( options ) { 87 return this.each( function() { 88 $( this ).data( '_navSearch', new NavSearch( this, options ) ); 89 } ); 90 }; 91 92} ).call( this, jQuery ); 93( function( $ ) { 94 "use strict"; 95 96 var win = $( window ); 97 98 /** 99 * This class will be used for handle 100 * the sticky content 101 */ 102 var StickyContent = function( container, options ) { 103 this.container = $( container ); 104 this.options = $.extend( { 105 item: '.sticky-content', 106 additionOffset: 0 107 }, options ); 108 109 this.content = $( this.options.item, container ); 110 111 /** 112 * This function will update the position 113 * of content element 114 * 115 * @return void 116 */ 117 this.update = function() { 118 var winScrollTop = win.scrollTop(), 119 winScrollBottom = win.scrollTop() + win.height(); 120 121 var containerOffset = this.container.offset(), 122 contentOffset = this.content.offset(); 123 124 containerOffset.bottom = containerOffset.top + this.container.height(); 125 contentOffset.bottom = contentOffset.top + this.content.height(); 126 127 if ( $.isFunction( this.options.additionOffset ) ) 128 winScrollTop += this.options.additionOffset.call( this ); 129 else if ( $.isNumeric( this.options.additionOffset ) ) 130 winScrollTop += this.options.additionOffset; 131 132 // Initial layout style 133 this.container.css( 'position', 'relative' ); 134 this.content.css( 'position', 'relative' ); 135 136 // Stick content to top 137 if ( this.content.height() < win.height() ) { 138 var top = winScrollTop - containerOffset.top, 139 maxTop = this.container.height() - this.content.height(); 140 141 if ( top > maxTop ) 142 top = this.container.height() - this.content.height(); 143 else if ( top < 0 ) 144 top = 0; 145 146 this.content.css( 'top', top ); 147 } 148 149 // Stick content to bottom 150 else { 151 if ( winScrollBottom > contentOffset.bottom && winScrollBottom < containerOffset.bottom ) 152 this.content.css( 'top', winScrollBottom - containerOffset.top - this.content.height() ); 153 else if ( winScrollTop < contentOffset.top && winScrollTop > containerOffset.top ) 154 this.content.css( 'top', winScrollTop - containerOffset.top ); 155 else if ( winScrollBottom > containerOffset.bottom )
156 this.content.css( 'top', this.container.height() - this.content.height() ); 157 else if ( winScrollTop < containerOffset.top ) 158 this.content.css( 'top', 0 ); 159 } 160 }; 161 162 /** 163 * Register event to update element 164 * position 165 */ 166 win.on( 'load resize scroll', this.update.bind( this ) ); 167 }; 168 169 $.fn['sticky_content'] = function( options ) { 170 return this.each( function( index, container ) { 171 console.log( $( container ).data( '_stickyContentInstance' ) ); 172 if ( $( container ).data( '_stickyContentInstance' ) === undefined ) 173 $( container ).data( '_stickyContentInstance', new StickyContent( container, options ) ); 174 } ); 175 }; 176 177} )( jQuery ); 178 179( function( $ ) { 180 "use strict"; 181 182 /** 183 * debouncing function from John Hann 184 * http://unscriptable.com/index.php/2009/03/20/debouncing-javascript-methods/ 185 */ 186 var debounce = function (func, threshold, execAsap) { 187 var timeout; 188 189 return function debounced () { 190 var obj = this, args = arguments; 191 function delayed () { 192 if (!execAsap) 193 func.apply(obj, args); 194 timeout = null; 195 }; 196 197 if (timeout) 198 clearTimeout(timeout); 199 else if (execAsap) 200 func.apply(obj, args); 201 202 timeout = setTimeout(delayed, threshold || 100); 203 }; 204 }; 205 206 /** 207 * Register smartresize plugin 208 */ 209 $.fn['smartresize'] = function(fn){ 210 return fn ? this.bind('resize', debounce(fn)) : this.trigger('smartresize'); 211 }; 212} ).call( this, jQuery ); 213( function( $ ) { 214 "use strict"; 215 216 var _defaults = {}, 217 _win = $( window ), 218 _doc = $( document ); 219 220 var _targets = {}; 221 222 function NavigatorSpy( element, options ) { 223 this.root = $( element ); 224 this.opts = $.extend( _defaults, options ); 225 this.collectTargets(); 226 227 // Register target visible event 228 this.root.on( '_navigatorSpy.targetVisible', this.visible.bind( this ) ); 229 230 _win.on( 'scroll', this.update.bind( this ) ); 231 _win.on( 'resize', this.update.bind( this ) ); 232 _win.on( 'load', this.update.bind( this ) ); 233 }; 234 235 NavigatorSpy.prototype = { 236 /** 237 * This method will handle events scroll, resize, load 238 * of the window object. It will find the visible element 239 * inside window and trigger a custom event for active the associated 240 * menu 241 * 242 * @return void 243 */ 244 update: function( evt ) { 245 var self = this; 246 247 // Run through each target and check it is visible 248 // in the viewport 249 $.each( _targets, function() { 250 var offset = this.offset(), 251 scrollTop = _win.scrollTop() + self.opts.offset; 252 253 // Calculate the additional offsets 254 offset.bottom = offset.top + this.height() + self.opts.offset; 255 offset.right = offset.left + this.width(); 256 257 // Check the element visible 258 if ( offset.top < scrollTop && offset.bottom > scrollTop ) { 259 self.root.trigger( '_navigatorSpy.targetVisible', { target: this } ); 260 } 261 } ); 262 }, 263 264 visible: function( evt, data ) { 265 $( '.current-menu-item', this.root ).removeClass( 'current-menu-item' ); 266 $( 'a[data-target="' + data.target.attr( 'id' ) + '"]', this.root ).closest( 'li' ).addClass( 'current-menu-item' ); 267 }, 268 269 /** 270 * Find all targets that linked from the navigator and 271 * push it into monitor list 272 * 273 * @return array 274 */ 275 collectTargets: function() { 276 $( 'a', this.root ).each( function() { 277 // We accept only link that pointed to current page and have hash segment 278 if ( this.href.indexOf( window.location.toString() ) !== false && this.hash != '' ) { 279 var target = $( this.hash ), 280 targetId = this.hash.substring( 1 ); 281 282 // Find the target based on hash 283 // and add it to targets list 284 if ( target.length > 0 ) { 285 if ( _targets[targetId] === undefined ) 286 _targets[targetId] = target; 287 288 $( this ).attr( 'data-target', targetId ); 289 } 290 } 291 } ); 292 } 293 }; 294 295 $.fn.navigatorSpy = function( options ) { 296 return this.each( function() { 297 $( this ).data( '_navigatorSpy', new NavigatorSpy( this, options ) ); 298 } ); 299 } 300 301} ).call( this, jQuery ); 302( function( $ ) { 303 "use strict"; 304 305 var win = $( window ); 306 307 /** 308 * Header sticky module 309 */ 310 var _defaults = { 311 position: 'relative', 312 additionOffset: 0, 313 updatePosition: function() {}, 314 onStick: function() {}, 315 onUnStick: function() {} 316 }; 317 318 /** 319 * Sticky header class 320 */ 321 var StickyHeader = function( element, options ) { 322 this.nav = $( element ); 323 this.options = $.extend( _defaults, options ); 324 this.stickTriggered = false;
325 326 /** 327 * Register the callback function that will 328 * update the navigator position 329 */ 330 if ( $.isFunction( this.options.updatePosition ) ) 331 this.nav.on( 'navPosition', this.options.updatePosition.bind( this ) ); 332 333 if ( $.isFunction( this.options.onStick ) ) 334 this.nav.on( 'navSticked', this.options.onStick.bind( this ) ); 335 336 if ( $.isFunction( this.options.onUnStick ) ) 337 this.nav.on( 'navReset', this.options.onUnStick.bind( this ) ); 338 339 /** 340 * This method will be called when window is scrolling 341 * for trigger event to make navigator to sticked 342 */ 343 this.doStick = function() { 344 var offsetTop = win.scrollTop(); 345 346 /** 347 * Try to retrieve original offset 348 */ 349 this.navOriginOffset = this.nav.data( 'origin-offset' ); 350 351 /** 352 * Store the original offset before 353 * make the navigator to sticked 354 */ 355 if ( this.navOriginOffset === undefined ) { 356 this.navOriginOffset = this.nav.offset(); 357 this.nav.data( 'origin-offset', this.navOriginOffset ); 358 } 359 360 /** 361 * Increase scrolltop if admin toolbar is 362 * appearing 363 */ 364 var additionOffset = $.isFunction( this.options.additionOffset ) 365 ? this.options.additionOffset.call( this ) 366 : parseInt( this.options.additionOffset ); 367 368 if ( $.isNumeric( additionOffset ) && additionOffset > 0 ) { 369 offsetTop = offsetTop + additionOffset; 370 } 371 372 /** 373 * Update class to make navigator to stick 374 * or not 375 */ 376 if ( offsetTop > this.navOriginOffset.top ) { 377 this.nav.addClass( 'stick' ); 378 379 if ( this.stickTriggered == false ) { 380 this.stickTriggered = true; 381 this.nav.trigger( 'navSticked' ); 382 } 383 384 this.nav.trigger( 'navPosition', { 385 offsetTop: offsetTop 386 } ); 387 } 388 else { 389 this.nav.removeClass( 'stick' ); 390 this.nav.removeAttr( 'style' ); 391 this.nav.trigger( 'navReset' ); 392 } 393 } 394 395 win.on( 'load scroll resize', this.doStick.bind( this ) ); 396 }; 397 398 $.fn['stickyHeader'] = function( options ) { 399 return this.each( function() { 400 $( this ).data( '_stickyHeader', new StickyHeader( this, options ) ); 401 } ); 402 }; 403 404} ).call( this, jQuery ); 405 406 407( function( $ ) { 408 "use strict"; 409 410 var _defaults = { 411 paginator: '', 412 container: 'body', 413 infiniteScroll: false, 414 success: function() {} 415 }; 416 417 function Pagination( element, options ) { 418 this.opts = $.extend( _defaults, options ); 419 this.root = $( this.opts.paginator ); 420 this.container = $( this.opts.container ); 421 this.isLoading = false; 422 423 this.addEvents(); 424 }; 425 426 Pagination.prototype = { 427 addEvents: function() { 428 var self = this; 429 430 this.root.on( 'click', 'a', function( e ) { 431 e.preventDefault(); 432 self.loadContent( this.href ); 433 } ); 434 }, 435 436 loadContent: function( url ) { 437 if ( this.isLoading == false ) { 438 // Set isLoading flag to prevent user send many times 439 // click to load more button 440 this.isLoading = true; 441 this.root.addClass( 'loading' ); 442 443 // Send ajax request to server that will retrieved 444 // content to be appended to container 445 $.get( url, ( function( response ) { 446 this.articles = $( this.opts.container, response ).children(); 447 this.paginator = $( this.opts.paginator, response ); 448 449 var isotope = this.container.data( 'isotope' ), 450 masonry = this.container.data( 'masonry' ); 451 452 if ( isotope || masonry ) { 453 this.articles.css( { 454 position: 'absolute', 455 visibility: 'hidden' 456 } ); 457 458 this.container.append( this.articles ); 459 this.container.imagesLoaded( ( function() { 460 isotope 461 ? this.container.isotope( 'once', 'layoutComplete', this.success.bind( this ) ) 462 : this.container.masonry( 'once', 'layoutComplete', this.success.bind( this ) ); 463 464 this.container.trigger( 'content-appended', { 465 'items': this.articles 466 } ); 467 } ).bind( this ) ); 468 469 return; 470 } 471 472 // Hide articles before append to it own container 473 this.container.append( this.articles ); 474 this.success(); 475 } ).bind( this ) ); 476 } 477 }, 478 479 success: function() { 480 this.root.replaceWith( this.paginator ); 481 this.opts.success(); 482 483 this.root = $( this.opts.paginator ); 484 this.addEvents(); 485
486 // Set isLoading back to false that will accept 487 // future request from user 488 this.isLoading = false; 489 } 490 }; 491 492 $.fn.pagination = function( options ) { 493 return this.each( function() { 494 $( this ).data( '_pagination', new Pagination( this, options ) ); 495 } ); 496 } 497 498} ).call( this, jQuery ); 499( function( $ ) { 500 "use strict"; 501 502 function MasonryLayout( element ) { 503 this.container = $( element ); 504 this.gridContainer = $( '.content-inner', element ); 505 506 this.container.on( 'content-appended', ( function( e, data ) { 507 data.items.imagesLoaded( ( function() { 508 this.gridContainer.masonry( 'layout' ); 509 // var frames = data.items.find( 'iframe' ); 510 // var frameLoaded = 0; 511 512 // frames.on( 'load', ( function() { 513 // frameLoaded++; 514 515 // if ( frameLoaded == frames.length ) { 516 517 // } 518 // } ).bind( this ) ); 519 520 data.items.css( 'visibility', 'visible' ); 521 this.gridContainer.masonry( 'appended', data.items ); 522 } ).bind( this ) ); 523 } ).bind( this ) ); 524 525 setTimeout( ( function() { 526 this.gridContainer.masonry( { 527 itemSelector: '.hentry' 528 } ); 529 } ).bind( this ), 500 ); 530 531 $( window ).smartresize( this.update.bind( this ) ); 532 }; 533 534 MasonryLayout.prototype = { 535 update: function() { 536 this.gridContainer.masonry( 'layout' ); 537 } 538 } 539 540 $.fn.masonryLayout = function( options ) { 541 return this.each( function() { 542 $( this ).data( '_masonryLayout', new MasonryLayout( this, options ) ); 543 } ); 544 }; 545 546} ).call( this, jQuery ); 547 548( function( $ ) { 549 "use strict"; 550 551 var _defaults = { speed: 4 }, 552 _win = $( window ); 553 554 var requestAnimFrame = ( function() { 555 return window.requestAnimationFrame || 556 window.webkitRequestAnimationFrame || 557 window.mozRequestAnimationFrame || 558 function( callback ) { 559 window.setTimeout( callback, 1000 / 60 ); 560 }; 561 } )(); 562 563 function Parallax( element, options ) { 564 this.root = $( element ); 565 this.opts = $.extend( _defaults, options ); 566 567 if ( this.root.attr( 'data-parallax-speed' ) !== undefined ) 568 this.opts.speed = parseInt( this.root.attr( 'data-parallax-speed' ) ); 569 570 // Cache the Y offset and the speed of each sprite 571 this.root.data( 'offsetY', parseInt( this.root.attr( 'data-parallax-y' ) ) ); 572 this.root.data( 'positionX', this.root.attr( 'data-parallax-x' ) ); 573 this.root.data( 'speed', this.root.attr('data-parallax-speed' )); 574 this.rootOffset = this.root.offset(); 575 576 requestAnimFrame( this.update.bind( this ) ); 577 578 // _win.on( 'scroll', this.update.bind( this ) ); 579 }; 580 581 Parallax.prototype = { 582 update: function() { 583 // If this section is in view 584 // if ( ( _win.scrollTop() + _win.height() ) > this.rootOffset.top && 585 // ( ( this.rootOffset.top + this.root.height() ) > _win.scrollTop() ) ) { 586 587 // Scroll the background at var speed 588 // the yPos is a negative value because we're scrolling it UP! 589 var yPos = -( _win.scrollTop() / this.root.data( 'speed' ) ); 590 591 // If this element has a Y offset then add it on 592 if ( this.root.data( 'offsetY' ) ) { 593 yPos += this.root.data( 'offsetY' ); 594 } 595 596 this.root.css( 'background-position', '50% '+ yPos + 'px' ); 597 // }; 598 599 requestAnimFrame( this.update.bind( this ) ); 600 } 601 }; 602 603 $.fn.parallax = function( options ) { 604 return this.each( function() { 605 $( this ).data( '_parallax', new Parallax( this, options ) ); 606 } ); 607 } 608 609} ).call( this, jQuery ); 610( function( $ ) { 611 "use strict"; 612 613 function MenuCollapse(element) { 614 this.element = $(element); 615 this.menuItems = $('.menu-item-has-children > a', this.element); 616 617 // Append the toggler for menu items 618 this.menuItems.after( 619 $('<span class="toggler" />') 620 ); 621 622 this.element.on('click', '> .navigator-toggle', this.toggle.bind(this)); 623 this.element.on('click', '.menu-item-has-children > .toggler', this.toggleItem.bind(this)); 624 }; 625 626 MenuCollapse.prototype = { 627 toggle: function(e) { 628 e.preventDefault(); 629 this.element.toggleClass('active'); 630 }, 631 632 toggleItem: function(e) { 633 e.preventDefault(); 634 $(e.target).closest('li').toggleClass('active'); 635 } 636 }; 637 638 $.fn.menuCollapse = function() { 639 return this.each( function() { 640 $( this ).data( '_menuCollapse', new MenuCollapse( this ) ); 641 } ); 642 }; 643 644} ).call( this, jQuery ); 645( function( $ ) { 646 "use strict"; 647 648 $.fn['projects'] = function() { 649 return this.each( function( index, container ) { 650 $( '> .projects-wrap > .projects-items', container ).imagesLoaded( function() { 651 $( '> .projects-wrap > .projects-items', container ).isotope( { 652 layoutMode: 'packery', 653 itemSelector: '.project', 654 percentPosition: true 655 } ); 656 657 $( '> .projects-wrap > .projects-filter li[data-filter] a', container ).on( 'click', function( e ) { 658 e.preventDefault(); 659 660 $( '> .projects-wrap > .projects-filter li', container ).removeClass( 'active' ); 661 $( '> .projects-wrap > .projects-items', container ).isotope( { 662 filter: $( this ).parent().attr( 'data-filter' ) 663 } ); 664 665 $( this ).parent().addClass( 'active' ); 666 $.waypoints( 'refresh' ); 667 $( window ).trigger( 'scroll' ); 668 } ); 669 670 $( '.projects-filter-toggler', container ).on( 'click', function( e ) {
671 $( '.projects-filter', container ).toggleClass( 'active' ); 672 } ); 673 674 $( '.project', container ).waypoint( function() { 675 var maxDuration = 0.7; 676 var minDuration = 0.4; 677 var randDuration = ( Math.random() * ( maxDuration - minDuration ) + minDuration ) + 's'; 678 679 $( '.project-wrap', this ) 680 .css( 'transition-duration', randDuration ) 681 .addClass( 'animate' ); 682 }, { 683 offset: '85%' 684 } ); 685 } ); 686 } ); 687 }; 688 689 $.fn['projectGallery'] = function() { 690 return this.each( function( index, container ) { 691 $( '.project-gallery-wrap', container ).imagesLoaded( function() { 692 $( '> .project-gallery-wrap', container ).isotope( { 693 layoutMode: 'packery', 694 itemSelector: '.project-media-item', 695 percentPosition: true 696 } ); 697 } ); 698 } ); 699 }; 700 701} )( jQuery ); 702 703( function( $ ) { 704 "use strict"; 705 706 var _initComponents = function( container ) { 707 if ( $.fn.fitVids ) $( '.fitVids', container ).fitVids(); 708 if ( $.fn.flexslider ) { 709 $( '.flexslider:not(.wpb_flexslider)', container ).each( function() { 710 var slider = $( this ), 711 config = { 712 animation: 'slide', 713 smoothHeight: true 714 }; 715 716 try { config = $.extend( config, JSON.parse( '{' + slider.attr( 'data-slider-config' ) + '}' ) ); } 717 catch( e ) {} 718 719 slider.flexslider( config ); 720 } ); 721 } 722 723 // Nivo Lightbox 724 $( '.gallery.gallery-has-lightbox a', container ).nivoLightbox( { 725 theme: 'default', 726 effect: 'fade' 727 } ); 728 729 // Related posts carousel 730 $( '.box-related-posts.box-related-posts-carousel' ).each( function() { 731 var root = $( this ); 732 733 $( '.box-content-wrap', root ).owlCarousel( { 734 items: root.attr( 'data-columns' ) || 3, 735 itemsDesktop: [991, root.attr( 'data-columns' ) || 3], 736 itemsTablet: [990, 2], 737 itemsMobile: [568,1], 738 autoHeight: true, 739 scrollPerPage: false, 740 navigation: true 741 } ); 742 } ); 743 744 // Initialize projects layout 745 $( '.projects:not(.projects-justify)' ).projects(); 746 $( '.project-gallery.project-gallery-grid' ).projectGallery(); 747 748 $( '.projects.projects-justify > .projects-wrap > .projects-items' ).imagesLoaded( function() { 749 $( '.projects.projects-justify > .projects-wrap > .projects-items' ).flexImages( { 750 container: '.project', 751 object: 'img', 752 rowHeight: 360 753 } ); 754 } ); 755 756 // Initialize project single 757 $( '.project-single.project-content-left.project-content-sticky,\ 758 .project-single.project-content-right.project-content-sticky' ).sticky_content( { 759 item: '.project-content', 760 additionOffset: function() { 761 return $( '#wpadminbar' ).height() + $( '#site-navigator.stick' ).height() + 20; 762 } 763 } ); 764 }; 765 766 $( function() { 767 var body = $( 'body' ); 768 769 // Initialize header toggler 770 $( '.header-v3 .menu-toggler a' ).on( 'click', function( e ) { 771 e.stopPropagation(); 772 $( '#site-navigator' ).toggleClass( 'active' ); 773 } ); 774 775 // Initialize header sticky feature 776 if ( _themeConfig.stickyHeader ) { 777 var placeholder = $( '<div class="masthead-placeholder"/>' ); 778 779 $( window ).on( 'scroll', function() { 780 if ( $( window ).scrollTop() > 0 ) { 781 $( 'body' ).addClass( 'header-sticked' ); 782 $( '#masthead' ).after( placeholder ); 783 784 placeholder.height( $( '#masthead' ).height() ); 785 } 786 else { 787 $( 'body' ).removeClass( 'header-sticked' ); 788 placeholder.detach(); 789 } 790 } ); 791 } 792 793 // Collapsible menu for mobile views 794 if ( _themeConfig.responsiveMenu ) { 795 $('.navigator-mobile').menuCollapse(); 796 } 797 798 // Modal content 799 if ( _themeConfig.offCanvas ) { 800 $( document ).on( 'click', '.navigator .off-canvas > a, .navigator-mobile .off-canvas > a', function( e ) { 801 e.preventDefault(); 802 $( 'body' ).toggleClass( 'off-canvas-active' ); 803 } ); 804 805 $( document ).on( 'click', '#off-canvas .close', function( e ) { 806 e.preventDefault(); 807 $( 'body' ).removeClass( 'off-canvas-active' ); 808 } ); 809 } 810 811 // Onepage Navigator 812 if ( _themeConfig.onepageNavigator ) { 813 $( '#site-header .navigator a, #site-header .navigator-mobile a' ).contentReveal( { 814 offset: $( '#wpadminbar' ).height(), 815 complete: function( evt ) { 816 $( window ).trigger( 'scroll' ); 817 } 818 } ); 819 820 $( '#site-header .navigator, #site-header .navigator-mobile' ).navigatorSpy( { 821 offset: $( '#masthead-sticky' ).height() + $( '#wpadminbar' ).height() 822 } ); 823 } 824 825 // Ajax pagination 826 if ( _themeConfig.pagingStyle == 'loadmore' ) { 827 $( '.navigation.paging-navigation.loadmore' ).pagination( { 828 paginator: _themeConfig.pagingNavigator, 829 container: _themeConfig.pagingContainer, 830 infiniteScroll: false, 831 success: function() { 832 _initComponents( $( '#main-content > .main-content-wrap > .content-inner' ) ); 833 } 834 } ); 835 } 836 837 // Nivo Lightbox 838 if ( $.fn.nivoLightbox ) { 839 $( 'a[data-lightbox="nivoLightbox"]' ).nivoLightbox( { 840 theme: 'default', 841 effect: 'fade' 842 } ); 843 } 844 845 $( 'a.content-reveal' ).contentReveal(); 846 $( '.navigator .search-box' ).navSearch(); 847 848 body.imagesLoaded( function() { 849 // Global components
850 _initComponents( body ); 851 852 // Blog masonry layout 853 if ( body.hasClass( 'blog-grid' ) ) { 854 $( '.main-content-wrap' ).masonryLayout(); 855 } 856 } ); 857 } ); 858 859 /** 860 * Initialize gotop button 861 * 862 * @return void 863 */ 864 $( function() { 865 var gotop = $( '.goto-top' ); 866 867 $( 'body' ).imagesLoaded( function() { 868 $.stellar({ horizontalScrolling: false }); 869 } ); 870 871 $( document ).on( 'woocommerce-cart-changed', function( e, data ) { 872 if ( parseInt( data.items_count ) > 0 ) { 873 $( '.shopping-cart-items-count' ) 874 .text( data.items_count ) 875 .removeClass( 'no-items' ); 876 } 877 else { 878 $( '.shopping-cart-items-count' ) 879 .empty() 880 .addClass( 'no-items' ); 881 } 882 } ); 883 884 // Goto Top button 885 $( 'a', gotop ).on( 'click', function( e ) { 886 e.preventDefault(); 887 888 $( 'html, body' ).animate( { 889 scrollTop: 0 890 } ); 891 } ); 892 893 $( window ).on( 'scroll', function() { 894 if ( $( window ).scrollTop() > 0 ) $( '.goto-top' ).addClass( 'active' ); 895 else $( '.goto-top' ).removeClass( 'active' ); 896 } ).on( 'load', function() { 897 $( window ).trigger( 'scroll' ); 898 } ); 899 } ); 900} ).call( this, 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.