1jQuery( document ).ready( function( $ ) { 2 3 // Toggle mobile-menu 4 $( ".nav-toggle" ).on( "click", function() { 5 $( this ).toggleClass( "active" ); 6 $( ".mobile-menu" ).slideToggle(); 7 if ( $( ".search-toggle" ).hasClass( "active" ) ) { 8 $( ".search-toggle" ).removeClass( "active" ); 9 $( ".mobile-search" ).slideToggle(); 10 } 11 return false; 12 } ); 13 14 // Toggle mobile-search 15 $( ".search-toggle" ).on( "click", function() { 16 $( this ).toggleClass( "active" ); 17 $( ".mobile-search" ).slideToggle(); 18 if ( $( ".nav-toggle" ).hasClass( "active" ) ) { 19 $( ".nav-toggle" ).removeClass( "active" ); 20 $( ".mobile-menu" ).slideToggle(); 21 } 22 return false; 23 } ); 24 25 // Hide/show mobile menu/search block > 900 26 $( window ).resize( function() { 27 if ( $( window ).width() > 1000 ) { 28 $( ".toggle" ).removeClass( "active" ); 29 $( ".mobile-menu" ).hide(); 30 $( ".mobile-search" ).hide(); 31 } 32 } ); 33 34 // Dropdown menus on touch devices 35 $( '.main-menu li.menu-item-has-children' ).doubleTapToGo(); 36 37 // Display dropdown menus on focus. 38 $( '.main-menu a' ).on( 'blur focus', function( e ) { 39 $( this ).parents( 'li.menu-item-has-children' ).toggleClass( 'focus' ); 40 } ); 41 42 // Resize videos after container 43 var vidSelector = ".post iframe, .post object, .post video, .widget-content iframe, .widget-content object, .widget-content iframe"; 44 var resizeVideo = function( sSel ) { 45 $( sSel ).each( function() { 46 var $video = $( this ), 47 $container = $video.parent(), 48 iTargetWidth = $container.width(); 49 50 if ( ! $video.attr( "data-origwidth" ) ) { 51 $video.attr( "data-origwidth", $video.attr( "width" ) ); 52 $video.attr( "data-origheight", $video.attr( "height" ) ); 53 } 54 55 var ratio = iTargetWidth / $video.attr( "data-origwidth" ); 56 57 $video.css( "width", iTargetWidth + "px" ); 58 $video.css( "height", ( $video.attr( "data-origheight" ) * ratio ) + "px" ); 59 }); 60 }; 61 62 resizeVideo( vidSelector ); 63 64 $( window ).resize( function() { 65 resizeVideo( vidSelector ); 66 } ); 67 68 // When Jetpack Infinite scroll posts have loaded 69 $( document.body ).on( 'post-load', function() { 70 71 var $container = $( '.posts' ); 72 $container.masonry( 'reloadItems' ); 73 74 $blocks.imagesLoaded( function() { 75 $blocks.masonry({ 76 itemSelector: '.post-container' 77 } ); 78 79 // Fade blocks in after images are ready (prevents jumping and re-rendering) 80 $( ".post-container" ).fadeIn(); 81 } ); 82 83 // Rerun video resizing 84 resizeVideo( vidSelector ); 85 86 $container.masonry( 'reloadItems' ); 87 88 // Load Flexslider 89 $( ".flexslider" ).flexslider( { 90 animation: "slide", 91 controlNav: false, 92 nextText: "Next", 93 prevText: "Previous", 94 smoothHeight: true 95 } ); 96 97 $( document ).ready( function() { 98 setTimeout( function() { 99 $blocks.masonry(); 100 }, 500 ); 101 } ); 102 103 } ); 104 105} );
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.