https://www.bendydog.com/Bendydognew/wp-content/themes/salient/js/third-party/superfish_ver-1.4.8.js
1/* 2 * jQuery Superfish Menu Plugin - v1.7.4 3 * Copyright (c) 2013 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 10;(function ($) { 11 "use strict"; 12 13 var methods = (function () { 14 // private properties and methods go here 15 var c = { 16 bcClass: 'sf-breadcrumb', 17 menuClass: 'sf-js-enabled', 18 anchorClass: 'sf-with-ul', 19 menuArrowClass: 'sf-arrows' 20 }, 21 ios = (function () { 22 var ios = /iPhone|iPad|iPod/i.test(navigator.userAgent); 23 if (ios) { 24 // iOS clicks only bubble as far as body children 25 $(window).load(function () { 26 $('body').children().on('click', $.noop); 27 }); 28 } 29 return ios; 30 })(), 31 wp7 = (function () { 32 var style = document.documentElement.style; 33 return ('behavior' in style && 'fill' in style && /iemobile/i.test(navigator.userAgent)); 34 })(), 35 toggleMenuClasses = function ($menu, o) { 36 var classes = c.menuClass; 37 if (o.cssArrows) { 38 classes += ' ' + c.menuArrowClass; 39 } 40 $menu.toggleClass(classes); 41 }, 42 setPathToCurrent = function ($menu, o) { 43 return $menu.find('li.' + o.pathClass).slice(0, o.pathLevels) 44 .addClass(o.hoverClass + ' ' + c.bcClass) 45 .filter(function () { 46 return ($(this).children(o.popUpSelector).hide().show().length); 47 }).removeClass(o.pathClass); 48 }, 49 toggleAnchorClass = function ($li) { 50 $li.children('a').toggleClass(c.anchorClass); 51 }, 52 toggleTouchAction = function ($menu) { 53 var touchAction = $menu.css('ms-touch-action'); 54 touchAction = (touchAction === 'pan-y') ? 'auto' : 'pan-y'; 55 $menu.css('ms-touch-action', touchAction); 56 }, 57 applyHandlers = function ($menu, o) { 58 var targets = 'li:has(' + o.popUpSelector + ')'; 59 if ($.fn.hoverIntent && !o.disableHI) { 60 $menu.hoverIntent(over, out, targets); 61 } 62 else { 63 $menu 64 .on('mouseenter.superfish', targets, over) 65 .on('mouseleave.superfish', targets, out); 66 } 67 var touchevent = 'MSPointerDown.superfish'; 68 if (!ios) { 69 touchevent += ' touchend.superfish'; 70 } 71 if (wp7) { 72 touchevent += ' mousedown.superfish'; 73 } 74 $menu 75 .on('focusin.superfish', 'li', over) 76 .on('focusout.superfish', 'li', out) 77 .on(touchevent, 'a', o, touchHandler); 78 }, 79 touchHandler = function (e) { 80 var $this = $(this), 81 $ul = $this.siblings(e.data.popUpSelector); 82 83 if ($ul.length > 0 && $ul.is(':hidden')) { 84 $this.one('click.superfish', false); 85 if (e.type === 'MSPointerDown') { 86 $this.trigger('focus'); 87 } else { 88 $.proxy(over, $this.parent('li'))(); 89 } 90 } 91 }, 92 over = function () { 93 var $this = $(this), 94 o = getOptions($this); 95 96 if($(this).parents('.megamenu').length > 0) return; 97 98 clearTimeout(o.sfTimer); 99 $this.siblings().superfish('hide').end().superfish('show'); 100 }, 101 out = function () { 102 var $this = $(this), 103 o = getOptions($this); 104 if (ios) { 105 $.proxy(close, $this, o)(); 106 } 107 else { 108 clearTimeout(o.sfTimer); 109 o.sfTimer = setTimeout($.proxy(close, $this, o), o.delay); 110 } 111 }, 112 close = function (o) { 113 o.retainPath = ($.inArray(this[0], o.$path) > -1); 114 this.superfish('hide'); 115 116 if (!this.parents('.' + o.hoverClass).length) { 117 o.onIdle.call(getMenu(this)); 118 if (o.$path.length) { 119 $.proxy(over, o.$path)(); 120 } 121 } 122 }, 123 getMenu = function ($el) { 124 return $el.closest('.' + c.menuClass); 125 }, 126 getOptions = function ($el) { 127 return getMenu($el).data('sf-options'); 128 }; 129 130 return { 131 // public methods 132 hide: function (instant) { 133 if (this.length) { 134 var $this = this, 135 o = getOptions($this); 136 if (!o) { 137 return this; 138 } 139 140 if($(this).hasClass('menu-item-over') && $(this).hasClass('megamenu')) { 141 return true; 142 } 143 144 var not = (o.retainPath === true) ? o.$path : '', 145 $ul = $this.find('li.' + o.hoverClass).add(this).not(not).removeClass(o.hoverClass).children(o.popUpSelector), 146 speed = o.speedOut; 147 148 if (instant) { 149 $ul.show(); 150 speed = 0; 151 } 152 o.retainPath = false;
153 o.onBeforeHide.call($ul); 154 155 if(o.dropdownStyle == 'minimal') { 156 var $this = $(this); 157 o.onHide.call($this); 158 } else { 159 160 $ul.stop(true, true).animate(o.animationOut, speed, function () { 161 var $this = $(this); 162 o.onHide.call($this); 163 }); 164 } 165 166 if($(this).parents('.megamenu').length > 0) return; 167 168 //megamenu removes transparent option 169 if($('#header-outer[data-megamenu-rt="1"]').length > 0 && $('#header-outer[data-transparent-header="true"]').length > 0) { 170 171 if($('#header-outer.scrolled-down').length == 0 && $('#header-outer.small-nav').length == 0 && $('#header-outer.detached').length == 0 && $('#header-outer.fixed-menu').length == 0) { 172 $('#header-outer').addClass('transparent'); 173 } 174 if($('#header-outer[data-permanent-transparent="1"][data-transparent-header="true"]').length > 0) { 175 $('#header-outer').addClass('transparent'); 176 } 177 178 } 179 } 180 return this; 181 }, 182 show: function () { 183 184 if($(this).parents('.megamenu').length > 0) return; 185 186 var o = getOptions(this); 187 if (!o) { 188 return this; 189 } 190 var $this = this.addClass(o.hoverClass), 191 $ul = $this.children(o.popUpSelector); 192 193 194 //megamenu removes transparent option 195 if($('#header-outer[data-megamenu-rt="1"]').length > 0 && $(this).hasClass('megamenu') && $('#header-outer').attr('data-transparent-header') == 'true' ) { 196 197 $('#header-outer').addClass('no-transition'); 198 $('#header-outer').removeClass('transparent'); 199 200 } 201 202 o.onBeforeShow.call($ul); 203 204 205 //make sure the ul has space 206 if(!$($ul).parents('li').hasClass('megamenu') && !$($ul).parents('ul').hasClass('sub-menu') && $ul.offset()) { 207 208 $ul.addClass('temp-hidden-display'); 209 var docW = $("#top .container").width(); 210 var elm = $ul; 211 var off = elm.offset(); 212 var l = off.left - ($(window).width() - docW)/2; 213 var w = elm.width(); 214 var isEntirelyVisible = (l+w <= $(window).width()-100); 215 216 if ( ! isEntirelyVisible ) { 217 $ul.parents('li').addClass('edge'); 218 } else { 219 $ul.parents('li').removeClass('edge'); 220 } 221 $ul.removeClass('temp-hidden-display'); 222 223 } 224 225 if(o.dropdownStyle == 'minimal') { 226 o.onShow.call($ul); 227 } else { 228 $ul.stop(true, true).animate(o.animation, o.speed, function () { 229 o.onShow.call($ul); 230 }); 231 } 232 233 //show on left class 234 if( $ul.length > 0 && $ul.parents('.sub-menu').length > 0 && $ul.parents('.sf-menu').length > 0 ) { 235 if($ul.offset().left + $ul.outerWidth() > $(window).width()) { 236 $ul.addClass('on-left-side'); 237 $ul.find('ul').addClass('on-left-side'); 238 } 239 } 240 241 242 return this; 243 }, 244 destroy: function () { 245 return this.each(function () { 246 var $this = $(this), 247 o = $this.data('sf-options'), 248 $hasPopUp; 249 if (!o) { 250 return false; 251 } 252 $hasPopUp = $this.find(o.popUpSelector).parent('li'); 253 clearTimeout(o.sfTimer); 254 toggleMenuClasses($this, o); 255 toggleAnchorClass($hasPopUp); 256 toggleTouchAction($this); 257 // remove event handlers 258 $this.off('.superfish').off('.hoverIntent'); 259 // clear animation's inline display style 260 $hasPopUp.children(o.popUpSelector).attr('style', function (i, style) { 261 return style.replace(/display[^;]+;?/g, ''); 262 }); 263 // reset 'current' path classes 264 o.$path.removeClass(o.hoverClass + ' ' + c.bcClass).addClass(o.pathClass); 265 $this.find('.' + o.hoverClass).removeClass(o.hoverClass); 266 o.onDestroy.call($this); 267 $this.removeData('sf-options'); 268 }); 269 }, 270 init: function (op) { 271 return this.each(function () { 272 var $this = $(this); 273 if ($this.data('sf-options')) { 274 return false; 275 } 276 var o = $.extend({}, $.fn.superfish.defaults, op), 277 $hasPopUp = $this.find(o.popUpSelector).parent('li'); 278 o.$path = setPathToCurrent($this, o); 279 280 $this.data('sf-options', o); 281 282 toggleMenuClasses($this, o); 283 toggleAnchorClass($hasPopUp); 284 toggleTouchAction($this); 285 applyHandlers($this, o); 286 287 $hasPopUp.not('.' + c.bcClass).superfish('hide', true); 288 289 o.onInit.call(this); 290 }); 291 } 292 }; 293 })(); 294 295 $.fn.superfish = function (method, args) { 296 if (methods[method]) { 297 return methods[method].apply(this, Array.prototype.slice.call(arguments, 1)); 298 } 299 else if (typeof method === 'object' || ! method) { 300 return methods.init.apply(this, arguments); 301 } 302 else { 303 return $.error('Method ' + method + ' does not exist on jQuery.fn.superfish'); 304 } 305 }; 306 307 $.fn.superfish.defaults = { 308 popUpSelector: 'ul,.sf-mega', // within menu context 309 hoverClass: 'sfHover', 310 pathClass: 'overrideThisToUse', 311 pathLevels: 1, 312 delay: 800, 313 animation: {opacity: 'show'}, 314 animationOut: {opacity: 'hide'},
315 speed: 'normal', 316 speedOut: 'fast', 317 cssArrows: true, 318 disableHI: false, 319 onInit: $.noop, 320 onBeforeShow: $.noop, 321 onShow: $.noop, 322 onBeforeHide: $.noop, 323 onHide: $.noop, 324 onIdle: $.noop, 325 onDestroy: $.noop, 326 dropdownStyle: ($('body[data-dropdown-style="minimal"]').length > 0) ? 'minimal' : 'classic' 327 }; 328 329 // soon to be deprecated 330 $.fn.extend({ 331 hideSuperfishUl: methods.hide, 332 showSuperfishUl: methods.show 333 }); 334 335})(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.