1 line
4.0 KiB
JavaScript
Vendored
1 line
4.0 KiB
JavaScript
Vendored
!function(e,s){"use strict";var t,o,n,i,r,a,h,l,p,u,f,c,d,v,m,y,C,w=(o="sf-breadcrumb",n="sf-js-enabled",i="sf-with-ul",r="sf-arrows",a=function(){var s=/^(?![\w\W]*Windows Phone)[\w\W]*(iPhone|iPad|iPod)/i.test(navigator.userAgent);return s&&e("html").css("cursor","pointer").on("click",e.noop),s}(),h="behavior"in(t=document.documentElement.style)&&"fill"in t&&/iemobile/i.test(navigator.userAgent),l=!!s.PointerEvent,p=function(e,s,t){var o=n;s.cssArrows&&(o+=" "+r),e[t?"addClass":"removeClass"](o)},u=function(e,s){var t=s?"addClass":"removeClass";e.children("a")[t](i)},f=function(e){var s=e.css("ms-touch-action"),t=e.css("touch-action");t="pan-y"===(t=t||s)?"auto":"pan-y",e.css({"ms-touch-action":t,"touch-action":t})},c=function(e){return e.closest("."+n)},d=function(e){return c(e).data("sfOptions")},v=function(){var s=e(this),t=d(s);clearTimeout(t.sfTimer),s.siblings().superfish("hide").end().superfish("show")},m=function(s){s.retainPath=e.inArray(this[0],s.$path)>-1,this.superfish("hide"),this.parents("."+s.hoverClass).length||(s.onIdle.call(c(this)),s.$path.length&&e.proxy(v,s.$path)())},y=function(){var s=e(this),t=d(s);a?e.proxy(m,s,t)():(clearTimeout(t.sfTimer),t.sfTimer=setTimeout(e.proxy(m,s,t),t.delay))},C=function(s){var t=e(this),o=d(t),n=t.siblings(s.data.popUpSelector);if(!1===o.onHandleTouch.call(n))return this;n.length>0&&n.is(":hidden")&&(t.one("click.superfish",!1),"MSPointerDown"===s.type||"pointerdown"===s.type?t.trigger("focus"):e.proxy(v,t.parent("li"))())},{hide:function(s){if(this.length){var t=d(this);if(!t)return this;var o=!0===t.retainPath?t.$path:"",n=this.find("li."+t.hoverClass).add(this).not(o).removeClass(t.hoverClass).children(t.popUpSelector),i=t.speedOut;if(s&&(n.show(),i=0),t.retainPath=!1,!1===t.onBeforeHide.call(n))return this;n.stop(!0,!0).animate(t.animationOut,i,function(){var s=e(this);t.onHide.call(s)})}return this},show:function(){var e=d(this);if(!e)return this;var s=this.addClass(e.hoverClass).children(e.popUpSelector);return!1===e.onBeforeShow.call(s)?this:(s.stop(!0,!0).animate(e.animation,e.speed,function(){e.onShow.call(s)}),this)},destroy:function(){return this.each(function(){var s,t=e(this),n=t.data("sfOptions");if(!n)return!1;s=t.find(n.popUpSelector).parent("li"),clearTimeout(n.sfTimer),p(t,n),u(s),f(t),t.off(".superfish").off(".hoverIntent"),s.children(n.popUpSelector).attr("style",function(e,s){if(void 0!==s)return s.replace(/display[^;]+;?/g,"")}),n.$path.removeClass(n.hoverClass+" "+o).addClass(n.pathClass),t.find("."+n.hoverClass).removeClass(n.hoverClass),n.onDestroy.call(t),t.removeData("sfOptions")})},init:function(s){return this.each(function(){var t=e(this);if(t.data("sfOptions"))return!1;var n=e.extend({},e.fn.superfish.defaults,s),i=t.find(n.popUpSelector).parent("li");n.$path=function(s,t){return s.find("li."+t.pathClass).slice(0,t.pathLevels).addClass(t.hoverClass+" "+o).filter(function(){return e(this).children(t.popUpSelector).hide().show().length}).removeClass(t.pathClass)}(t,n),t.data("sfOptions",n),p(t,n,!0),u(i,!0),f(t),function(s,t){var o="li:has("+t.popUpSelector+")";e.fn.hoverIntent&&!t.disableHI?s.hoverIntent(v,y,o):s.on("mouseenter.superfish",o,v).on("mouseleave.superfish",o,y);var n="MSPointerDown.superfish";l&&(n="pointerdown.superfish"),a||(n+=" touchend.superfish"),h&&(n+=" mousedown.superfish"),s.on("focusin.superfish","li",v).on("focusout.superfish","li",y).on(n,"a",t,C)}(t,n),i.not("."+o).superfish("hide",!0),n.onInit.call(this)})}});e.fn.superfish=function(s,t){return w[s]?w[s].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof s&&s?e.error("Method "+s+" does not exist on jQuery.fn.superfish"):w.init.apply(this,arguments)},e.fn.superfish.defaults={popUpSelector:"ul,.sf-mega",hoverClass:"sfHover",pathClass:"overrideThisToUse",pathLevels:1,delay:800,animation:{opacity:"show"},animationOut:{opacity:"hide"},speed:"normal",speedOut:"fast",cssArrows:!0,disableHI:!1,onInit:e.noop,onBeforeShow:e.noop,onShow:e.noop,onBeforeHide:e.noop,onHide:e.noop,onIdle:e.noop,onDestroy:e.noop,onHandleTouch:e.noop}}(jQuery,window); |