/* * jQuery Superfish Menu Plugin - v1.7.6 * Small tweaks to 'show' and 'hide' methods by Olevmedia * Copyright (c) 2013 Joel Birch * * Dual licensed under the MIT and GPL licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html */ !function(e,s){"use strict";var t=function(){var t={bcClass:"sf-breadcrumb",menuClass:"sf-js-enabled",anchorClass:"sf-with-ul",menuArrowClass:"sf-arrows"},o=function(){var t=/iPhone|iPad|iPod/i.test(navigator.userAgent);return t&&e(s).load(function(){e("body").children().on("click",e.noop)}),t}(),n=function(){var e=document.documentElement.style;return"behavior"in e&&"fill"in e&&/iemobile/i.test(navigator.userAgent)}(),i=function(){return!!s.PointerEvent}(),r=function(e,s){var o=t.menuClass;s.cssArrows&&(o+=" "+t.menuArrowClass),e.toggleClass(o)},a=function(s,o){return s.find("li."+o.pathClass).slice(0,o.pathLevels).addClass(o.hoverClass+" "+t.bcClass).filter(function(){return e(this).children(o.popUpSelector).hide().show().length}).removeClass(o.pathClass)},l=function(e){e.children("a").toggleClass(t.anchorClass)},h=function(e){var s=e.css("ms-touch-action"),t=e.css("touch-action");t=t||s,t="pan-y"===t?"auto":"pan-y",e.css({"ms-touch-action":t,"touch-action":t})},u=function(s,t){var r="li:has("+t.popUpSelector+")";e.fn.hoverIntent&&!t.disableHI?s.hoverIntent(c,f,r):s.on("mouseenter.superfish",r,c).on("mouseleave.superfish",r,f);var a="MSPointerDown.superfish";i&&(a="pointerdown.superfish"),o||(a+=" touchend.superfish"),n&&(a+=" mousedown.superfish"),s.on("focusin.superfish","li",c).on("focusout.superfish","li",f).on(a,"a",t,p)},p=function(s){var t=e(this),o=m(t),n=t.siblings(s.data.popUpSelector);return o.onHandleTouch.call(n)===!1?this:void(n.length>0&&n.is(":hidden")&&(t.one("click.superfish",!1),"MSPointerDown"===s.type||"pointerdown"===s.type?t.trigger("focus"):e.proxy(c,t.parent("li"))()))},c=function(){var s=e(this),t=m(s);clearTimeout(t.sfTimer),s.siblings().superfish("hide").end().superfish("show")},f=function(){var s=e(this),t=m(s);o?e.proxy(d,s,t)():(clearTimeout(t.sfTimer),t.sfTimer=setTimeout(e.proxy(d,s,t),t.delay))},d=function(s){s.retainPath=e.inArray(this[0],s.$path)>-1,this.superfish("hide"),this.parents("."+s.hoverClass).length||(s.onIdle.call(v(this)),s.$path.length&&e.proxy(c,s.$path)())},v=function(e){return e.closest("."+t.menuClass)},m=function(e){return v(e).data("sf-options")};return{hide:function(s){if(this.length){var t=this,o=m(t);if(!o)return this;var n=o.retainPath===!0?o.$path:"",i=t.find("li."+o.hoverClass).add(this).not(n).removeClass(o.hoverClass).children(o.popUpSelector),r=o.speedOut;if(s&&(i.show(),r=0),o.retainPath=!1,o.onBeforeHide.call(i)===!1)return this;if(r)jQuery.isEmptyObject(o.animationOut)?(i.stop(!0,!0),i.data("sf-hide-timer",setTimeout(function(){i.hide();var s=e(this);o.onHide.call(s)},r))):i.stop(!0,!0).animate(o.animationOut,r,function(){var s=e(this);o.onHide.call(s)});else{i.stop(!0,!0).hide();var t=e(this);o.onHide.call(t)}}return this},show:function(){var e=m(this);if(!e)return this;var s=this.addClass(e.hoverClass),t=s.children(e.popUpSelector);return e.onBeforeShow.call(t)===!1?this:(t.data("sf-hide-timer")&&clearTimeout(t.data("sf-hide-timer")),e.speed?t.stop(!0,!0).animate(e.animation,e.speed,function(){e.onShow.call(t)}):t.stop(!0,!0).show(0,function(){e.onShow.call(t)}),this)},destroy:function(){return this.each(function(){var s,o=e(this),n=o.data("sf-options");return n?(s=o.find(n.popUpSelector).parent("li"),clearTimeout(n.sfTimer),r(o,n),l(s),h(o),o.off(".superfish").off(".hoverIntent"),s.children(n.popUpSelector).attr("style",function(e,s){return s.replace(/display[^;]+;?/g,"")}),n.$path.removeClass(n.hoverClass+" "+t.bcClass).addClass(n.pathClass),o.find("."+n.hoverClass).removeClass(n.hoverClass),n.onDestroy.call(o),void o.removeData("sf-options")):!1})},init:function(s){return this.each(function(){var o=e(this);if(o.data("sf-options"))return!1;var n=e.extend({},e.fn.superfish.defaults,s),i=o.find(n.popUpSelector).parent("li");n.$path=a(o,n),o.data("sf-options",n),r(o,n),l(i),h(o),u(o,n),i.not("."+t.bcClass).superfish("hide",!0),n.onInit.call(this)})}}}();e.fn.superfish=function(s){return t[s]?t[s].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof s&&s?e.error("Method "+s+" does not exist on jQuery.fn.superfish"):t.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);