1 2(function(window, document, undefined) 3{ 4 "use strict"; 5 // helper functions 6 7 var trim = function(str) 8 { 9 return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g,''); 10 }; 11 12 var hasClass = function(el, cn) 13 { 14 return (' ' + el.className + ' ').indexOf(' ' + cn + ' ') !== -1; 15 }; 16 17 var addClass = function(el, cn) 18 { 19 if (!hasClass(el, cn)) { 20 el.className = (el.className === '') ? cn : el.className + ' ' + cn; 21 } 22 }; 23 24 var removeClass = function(el, cn) 25 { 26 el.className = trim((' ' + el.className + ' ').replace(' ' + cn + ' ', ' ')); 27 }; 28 29 var hasParent = function(el, id) 30 { 31 if (el) { 32 do { 33 if (el.id === id) { 34 return true; 35 } 36 if (el.nodeType === 9) { 37 break; 38 } 39 } 40 while((el = el.parentNode)); 41 } 42 return false; 43 }; 44 45 // normalize vendor prefixes 46 47 var doc = document.documentElement; 48 49 var transform_prop = window.Modernizr.prefixed('transform'), 50 transition_prop = window.Modernizr.prefixed('transition'), 51 transition_end = (function() { 52 var props = { 53 'WebkitTransition' : 'webkitTransitionEnd', 54 'MozTransition' : 'transitionend', 55 'OTransition' : 'oTransitionEnd otransitionend', 56 'msTransition' : 'MSTransitionEnd', 57 'transition' : 'transitionend' 58 }; 59 return props.hasOwnProperty(transition_prop) ? props[transition_prop] : false; 60 })(); 61 62 window.App = (function() 63 { 64 65 var _init = false, app = { }; 66 67 app.init = function() 68 { 69 if (_init) { 70 return; 71 } 72 _init = true; 73 74 addClass(doc, 'js-ready'); 75 76 }; 77 78 return app; 79 80 })(); 81 var pagecontainer = document.getElementById( 'page-inner-wrap' ); 82 if (window.addEventListener) { 83 window.addEventListener('DOMContentLoaded', window.App.init, false); 84 } 85 jQuery('#nav-open-btn').on('click', function() { 86 jQuery(pagecontainer).find('.page-cover').css({"opacity":"0.5", "display":"block"}); 87 addClass(doc, 'js-nav'); 88 }); 89 90 jQuery('.mobile-menu-close').on('click', function() { 91 jQuery(pagecontainer).find('.page-cover').css({"opacity":"0.5", "display":"none"}); 92 removeClass(doc, 'js-nav'); 93 }); 94 95 96})(window, window.document);
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.