1 2// Customizable variables 3 4var _datMenuAnim = (typeof _datMenuAnim === "undefined") ? 400 :_datMenuAnim; // Animation time of revieling and hiding menu (defaut = 400) 5var _datMenuEffect = (typeof _datMenuEffect === "undefined") ? "effect-1" :_datMenuEffect; // Animation effect [effect-1, effect-2, effect-3] (defaut = "effect-1") 6var _datMenuSublist = (typeof _datMenuSublist === "undefined") ? true :_datMenuSublist; // Submenu dropdown animation (defaut = true) 7var _datMenuHeader = (typeof _datMenuHeader === "undefined") ? true :_datMenuHeader; // If fixed header is showing (defaut = true) 8var _datMenuHeaderTitle = (typeof _datMenuHeaderTitle === "undefined") ? 'Allegro' :_datMenuHeaderTitle; // Header Title 9var _datMenuSearch = (typeof _datMenuSearch === "undefined") ? true :_datMenuSearch; // If search is showing in header (defaut = true) 10 11var _datMenuCustomS = (typeof _datMenuCustomS === "undefined") ? "fa-search" :_datMenuCustomS; // Search icon in header (defaut = fa-search) 12var _datMenuCustomM = (typeof _datMenuCustomM === "undefined") ? "fa-bars" :_datMenuCustomM; // Menu icon in header (defaut = fa-bars) 13 14 15// Do not touch these variables 16var myScroll; 17 18jQuery(document).ready(function() { 19 20 var datlistclass = (_datMenuSublist)?" dat-submenu":""; 21 22 // Enables fallback for older browsers 23 if (!Modernizr.csstransforms3d) { 24 jQuery("body").addClass("no-csstransforms3d"); 25 } 26 27 // Sets up html for doing animations 28 jQuery("body").wrapInner(function () { 29 return '<div id="dat-menu" class="'+_datMenuEffect+'"><div class="dat-menu-container"><div class="dat-menu-wrapper"></div></div></div>'; 30 }); 31 32 jQuery("#dat-menu").append('<nav class="dat-menu-list'+datlistclass+'"><ul id="dat-menu-list-inner"></ul></nav>'); 33 if(_datMenuHeader){ 34 jQuery(".dat-menu-wrapper").addClass("dat-menu-padding"); 35 jQuery(".dat-menu-container").prepend('<div class="dat-menu-top-header">'+_datMenuHeaderTitle+'<form action=""><input type="text" name="s" value="" /><input type="submit" value="" /></form></div>'); 36 if(_datMenuSearch){ 37 jQuery(".dat-menu-top-header").prepend('<a href="#" class="dat-menu-search"><i class="fa '+_datMenuCustomS+'"></i></a>'); 38 } 39 jQuery(".dat-menu-top-header").prepend('<a href="#dat-menu" class="dat-menu-menu"><i class="fa '+_datMenuCustomM+'"></i></a>'); 40 } 41 42 jQuery(".dat-menu-top-header input[type='text']").bind("blur", function () { 43 jQuery(".dat-menu-top-header").css("position", "fixed").css("top", "0px"); 44 }); 45 46 jQuery(".dat-menu-top-header .dat-menu-search").bind("click", function () { 47 jQuery('html,body').animate({ 48 scrollTop: 0 49 }); 50 jQuery(".dat-menu-top-header").css("position", "absolute").css("top", "0px"); 51 jQuery(".dat-menu-top-header input[type='text']").focus(); 52 return false; 53 }); 54 55 // Collects all menu lists and places them into ".dat-menu-list > ul" 56 jQuery(".load-responsive").each(function() { 57 var _this = jQuery(this); 58 jQuery(".dat-menu-list > ul").append('<li class="dat-menu-header"><span>'+_this.attr('rel')+'</span></li>'+_this.html()); 59 }); 60 61 // Checks if menu has a submenu 62 jQuery(".dat-menu-list.dat-submenu > ul > li ul").each(function () { 63 var _this = jQuery(this).parent(); 64 _this.addClass("dat-has-sub"); 65 }); 66 67 // Copies body styles to ".dat-menu-container" 68 // Adds event to hide menu when clicked on page 69 var array = ['background','background-size','background-image', 'background-color', 'background-repeat', 'background-position']; 70 jQuery.each( array , function(item, value) { 71 jQuery(".dat-menu-container").css(value, jQuery("body").css(value)); 72 }); 73 74 // Submenu links dropdown animation 75 jQuery("#dat-menu-list-inner li > a").on("click tap", function () { 76 var _this = jQuery(this).parent(); 77 if(_this.hasClass("dat-has-sub") == false){ 78 var thisel = _this.children("a"); 79 window.location = thisel.attr("href"); 80 return true; 81 }else 82 if(_this.hasClass("dat-sub-active")){ 83 var thisel = _this.children("a"); 84 window.location = thisel.attr("href"); 85 return true; 86 }else{ 87 setTimeout(function () { 88 _this.addClass("dat-sub-active"); 89 }, 100); 90 _this.children("ul").children("li").css("display", "none").animate({height: "toggle"}, _datMenuAnim, function () { 91 myScroll.refresh();
92 }); 93 return false; 94 } 95 return false; 96 }); 97 98 jQuery(".dat-menu-container").on("mousedown", function () { 99 var _this = jQuery(this).parent(); 100 if(_this.hasClass("dat-menu-load")){ 101 var scrollpos = Math.abs(parseInt(jQuery('#dat-menu > .dat-menu-container > .dat-menu-wrapper').css("top"))); 102 _this.removeClass("dat-menu-animate"); 103 setTimeout(function () { 104 _this.removeClass("dat-menu-load"); 105 _this.removeClass("dat-menu-setup"); 106 jQuery(document).scrollTop(scrollpos); 107 jQuery("body").removeClass("datnomargin"); 108 }, _datMenuAnim+100); 109 return false; 110 } 111 return true; 112 }); 113 114 jQuery("#wpadminbar").appendTo("body"); 115 116 // Starts iScroll plugin for smooth menu scrolling 117 myScroll = new IScroll('.dat-menu-list', { 118 scrollbars: false, 119 mouseWheel: true, 120 interactiveScrollbars: false, 121 shrinkScrollbars: 'scale', 122 fadeScrollbars: false, 123 tap: true 124 }); 125 126 // Event on link #dat-menu, when pressed, reviels menu 127 jQuery('a[href="#dat-menu"]').on( "click", function() { 128 var scrollpos = jQuery(document).scrollTop(), 129 _datMenuMain = jQuery("#dat-menu"); 130 _datMenuMain.find(".dat-menu-wrapper").css("top", "-"+parseInt(scrollpos)+"px"); 131 _datMenuMain.addClass("dat-menu-setup"); 132 _datMenuMain.toggleClass("dat-menu-load"); 133 setTimeout(function () { 134 _datMenuMain.toggleClass("dat-menu-animate"); 135 }, 10); 136 jQuery("body").addClass("datnomargin"); 137 myScroll.refresh(); 138 return false; 139 }); 140 141});
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.