1( function( $ ) { 2 3 'use strict'; 4 5 function removeNoJsClass() { 6 $( 'html:first' ).removeClass( 'no-js' ); 7 } 8 9 /* Superfish the menu drops ---------------------*/ 10 function superfishSetup() { 11 $('.menu').superfish({ 12 delay: 200, 13 animation: {opacity:'show', height:'show'}, 14 speed: 'fast', 15 cssArrows: true, 16 autoArrows: true, 17 dropShadows: false 18 }); 19 } 20 21 /* Disable Superfish on mobile ---------------------*/ 22 function superfishMobile() { 23 var sf, body; 24 var breakpoint = 767; 25 body = $('body'); 26 sf = $('ul.menu'); 27 if ( body.width() >= breakpoint ) { 28 // Enable superfish when the page first loads if we're on desktop 29 sf.superfish(); 30 } 31 $(window).resize(function() { 32 if ( body.width() >= breakpoint && !sf.hasClass('sf-js-enabled') ) { 33 // You only want SuperFish to be re-enabled once (sf.hasClass) 34 sf.superfish('init'); 35 } else if ( body.width() < breakpoint ) { 36 // Smaller screen, disable SuperFish 37 sf.superfish('destroy'); 38 } 39 }); 40 } 41 42 function modifyPosts() { 43 44 /* Hide Comments When No Comments Activated ---------------------*/ 45 $('.nocomments').parent().css('display', 'none'); 46 47 /* Animate Page Scroll ---------------------*/ 48 $(".scroll").click(function(event){ 49 event.preventDefault(); 50 $('html,body').animate({scrollTop:$(this.hash).offset().top}, 500); 51 }); 52 53 /* Fit Vids ---------------------*/ 54 $('.content').fitVids(); 55 56 } 57 58 $( document ) 59 .ready( removeNoJsClass ) 60 .ready( superfishSetup ) 61 .ready( superfishMobile ) 62 .ready( modifyPosts ) 63 .on( 'post-load', modifyPosts ); 64 65})( 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.