1/* 2 * Superfish v1.4.8 - jQuery menu widget 3 * Copyright (c) 2008 Joel Birch 4 * 5 * Dual licensed under the MIT and GPL licenses: 6 * http://www.opensource.org/licenses/mit-license.php 7 * http://www.gnu.org/licenses/gpl.html 8 * 9 * CHANGELOG: http://users.tpg.com.au/j_birch/plugins/superfish/changelog.txt 10 * 11 * Edited to have the menu slide back up on mouse off (only tested for basic style) 12 */ 13 14;(function($){ 15 $.fn.superfish = function(op){ 16 17 var sf = $.fn.superfish, 18 c = sf.c, 19 $arrow = $(['<span class="',c.arrowClass,'"> <i class="fas fa-chevron-down"></i></span>'].join('')), 20 over = function(){ 21 var $$ = $(this), menu = getMenu($$); 22 clearTimeout(menu.sfTimer); 23 $$.showSuperfishUl().siblings().hideSuperfishUl(); 24 }, 25 out = function(){ 26 var $$ = $(this), menu = getMenu($$), o = sf.op; 27 clearTimeout(menu.sfTimer); 28 menu.sfTimer=setTimeout(function(){ 29 o.retainPath=($.inArray($$[0],o.$path)>-1); 30 $$.hideSuperfishUl(); 31 if (o.$path.length && $$.parents(['li.',o.hoverClass].join('')).length<1){over.call(o.$path);} 32 },o.delay); 33 }, 34 getMenu = function($menu){ 35 var menu = $menu.parents(['ul.',c.menuClass,':first'].join(''))[0]; 36 sf.op = sf.o[menu.serial]; 37 return menu; 38 }, 39 addArrow = function($a){ $a.addClass(c.anchorClass).append($arrow.clone()); }; 40 41 return this.each(function() { 42 var s = this.serial = sf.o.length; 43 var o = $.extend({},sf.defaults,op); 44 o.$path = $('li.'+o.pathClass,this).slice(0,o.pathLevels).each(function(){ 45 $(this).addClass([o.hoverClass,c.bcClass].join(' ')) 46 .filter('li:has(ul)').removeClass(o.pathClass); 47 }); 48 sf.o[s] = sf.op = o; 49 50 $('li:has(ul)',this)[($.fn.hoverIntent && !o.disableHI) ? 'hoverIntent' : 'hover'](over,out).each(function() { 51 if (o.autoArrows) addArrow( $('>a:first-child',this) ); 52 }) 53 .not('.'+c.bcClass) 54 .hideSuperfishInit(); 55 56 var $a = $('a',this); 57 $a.each(function(i){ 58 var $li = $a.eq(i).parents('li'); 59 $a.eq(i).focus(function(){over.call($li);}).blur(function(){out.call($li);}); 60 }); 61 o.onInit.call(this); 62 63 }).each(function() { 64 var menuClasses = [c.menuClass]; 65 if (sf.op.dropShadows && !($.browser.msie && $.browser.version < 7)) menuClasses.push(c.shadowClass); 66 $(this).addClass(menuClasses.join(' ')); 67 }); 68 }; 69 70 var sf = $.fn.superfish; 71 sf.o = []; 72 sf.op = {}; 73 sf.IE7fix = function(){ 74 var o = sf.op; 75 if ($.browser.msie && $.browser.version > 6 && o.dropShadows && o.animation.opacity!=undefined) 76 this.toggleClass(sf.c.shadowClass+'-off'); 77 }; 78 sf.c = { 79 bcClass : 'sf-breadcrumb', 80 menuClass : 'sf-js-enabled', 81 anchorClass : 'sf-with-ul', 82 arrowClass : 'sf-sub-indicator', 83 shadowClass : 'sf-shadow' 84 }; 85 86 $(document).ready(function() { 87 $("li.current_page_item").addClass("current_page_ancestor"); 88 }); 89 90 91 sf.defaults = { 92 hoverClass : 'sfHover', 93 pathClass : 'overrideThisToUse', 94 pathLevels : 1, 95 delay : 700, 96 animationOpen : {height:'show'}, 97 animationClose : {height:'hide'}, 98 speed : 'normal', 99 autoArrows : true, 100 dropShadows : false, 101 disableHI : false, // true disables hoverIntent detection 102 onInit : function(){}, // callback functions 103 onBeforeShow : function(){}, 104 onShow : function(){}, 105 onHide : function(){} 106 }; 107 $.fn.extend({ 108 hideSuperfishInit : function(){ 109 var o = sf.op, 110 not = (o.retainPath===true) ? o.$path : ''; 111 o.retainPath = false; 112 var $ul = $(['li.',o.hoverClass].join(''),this).add(this).not(not).removeClass(o.hoverClass) 113 .find('>ul').hide().css('visibility','hidden'); 114 o.onHide.call($ul); 115 return this; 116 }, 117 118 hideSuperfishUl : function(){ 119 var o = sf.op, 120 not = (o.retainPath===true) ? o.$path : ''; 121 o.retainPath = false; 122 var $ul = $(['li.',o.hoverClass].join(''),this).add(this).not(not).removeClass(o.hoverClass) 123 .find('>ul').animate(o.animationClose, o.speed, function() { $(this).css('visibility','hidden'); 124 }); 125 o.onHide.call($ul); 126 return this; 127 }, 128 129 showSuperfishUl : function(){ 130 var o = $.fn.superfish.op, 131 $ul = this.addClass(o.hoverClass) 132 .find('>ul:hidden').css('visibility','visible'); 133 o.onBeforeShow.call($ul); 134 $ul.animate(o.animationOpen,o.speed,function(){ o.onShow.call(this); }); 135 return this; 136 } 137 138 }); 139 140 141 142})(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.