text: /*!
  Off Canvas Infinity Push, a infinity push mobile navigation jQuery plugin.
  
  Version 1.0.2
  Full source at https://github.com/marc-andrew/off-canvas-infinity-push
  Copyright (c) 2014 Marc Andrew http://marcandrew.net/off-canvas-infinity-push
  
  MIT License (http://www.opensource.org/licenses/mit-license.html)
  */
  
  ;(function(e){e.fn.infinitypush=function(t){var n={offcanvas:true,offcanvasspeed:400,offcanvasleft:true,openingspeed:400,closingspeed:400,spacing:90,pushdirectionleft:true,autoScroll:false,scrollSpeed:300,transition:false,destroy:false};var r=this;var i=e.extend({},n,t);return this.each(function(){function b(){e("."+u).unbind();e("."+c).unbind();e("body").removeClass(d);e("."+n).next().removeAttr("style");e("."+n).find("."+m).removeClass(m).find("."+g).removeClass(g).find("."+y).remove();e("."+n).find("ul").removeAttr("style");r.prependTo(t).removeClass(c+" "+v);e("."+n).remove();e(this).removeClass(c);r.stop().removeAttr("style")}function w(){e("."+u).on("click",function(){if(e("body").hasClass(d)){E()}else{S()}})}function E(){if(i.offcanvasleft===true){e("."+n).stop().animate({left:"-"+T+"px"},i.offcanvasspeed)}else{e("."+n).stop().animate({right:"-"+T+"px"},i.offcanvasspeed)}e("."+c).stop().animate({opacity:"hide"},i.offcanvasspeed);if(i.offcanvasleft===true){e("."+n).next().stop().animate({left:0},i.offcanvasspeed)}else{e("."+n).next().stop().animate({right:0},i.offcanvasspeed)}e("body").removeClass(d)}function S(){e("body").addClass(d);if(i.offcanvasleft===true){e("."+n).stop().animate({left:0},i.offcanvasspeed)}else{e("."+n).stop().animate({right:0},i.offcanvasspeed)}e("."+c).stop().animate({opacity:"show"},i.offcanvasspeed);if(i.offcanvasleft===true){e("."+n).next().stop().animate({left:T+"px"},i.offcanvasspeed)}else{e("."+n).next().stop().animate({right:T+"px"},i.offcanvasspeed)}x()}function x(){e("."+d).on("mousedown touchstart",function(t){if(e("."+d).length){if(!e("."+n).is(t.target)&&e("."+n).has(t.target).length===0){E()}}})}var t=e(this).data("oldposition")||e("body"),n="ma-infinitypush-wrapper",s='<div class="'+n+'"></div>',o="ma-infinitypush-active-button",u="ma-infinitypush-button",a='<div class="'+u+'"></div>',f="ma-infinitypush-button-left",l="ma-infinitypush-button-right",c="ma-infinitypush",h="ma-infinitypush-left",p="ma-infinitypush-right",d="ma-infinitypush-open",v="ma-infinitypush-sub-open",m="ma-infinitypush-inactive",g="ma-infinitypush-active-item",y="ma-infinitypush-close-subnav";if(i.destroy){if(e(this).hasClass(c))b();return}if(!e(this).hasClass(c)){e(this).data("oldposition",e(this).parent());if(!e(this).parent().is("body")){e("body").prepend(e(this))}e(this).before(s).addClass(c).appendTo("."+n);var T=e("."+n).width();if(i.offcanvas===true){e(this).before(a);if(i.offcanvasleft===true){e("."+n).css({left:"-"+T+"px"}).addClass(f)}else{e("."+n).css({right:"-"+T+"px"}).addClass(l)}if(i.pushdirectionleft===true){e("."+n).addClass(h)}else{e("."+n).addClass(p)}e("."+n).addClass(o);w()}e("."+c).on("click","a",function(){var t=e(r).width(),n=e(this).parents(r).children("ul"),s=e(this).closest("ul"),o=e(this).parent().find("ul").first(),u='<a href="#" class="'+y+'"></a>';if(n.hasClass(m)&&n.siblings().not(m)){if(s.hasClass(m)){if(i.pushdirectionleft===true){s.find("ul").animate({right:-(t-i.spacing),opacity:"hide"},i.closingspeed)}else{s.find("ul").animate({left:-(t-i.spacing),opacity:"hide"},i.closingspeed)}if(e(this).parent().parent().parent().hasClass(v)){e(r).removeClass(v)}else{s.animate({width:t-i.spacing},i.closingspeed)}s.removeClass(m);s.find("ul").removeClass(m);s.siblings().removeClass(m);s.find("li").removeClass(g);s.find("."+y).animate({opacity:"hide"},i.closingspeed,function(){e(this).remove()});return false}else{if(o.length>0&&!o.is(":visible")){console.log("Open next Subnav");var a=s.scrollTop();e(this).parent().addClass(g);s.addClass(m);if(i.autoScroll===true){if(a>=1){s.animate({scrollTop:0},i.scrollSpeed)}}if(i.autoScroll===true){if(a>=1){e(u).delay(i.scrollSpeed).insertAfter(e(this)).css("display","none").animate({opacity:"show"},i.openingspeed)}else{e(u).insertAfter(e(this)).css("display","none").animate({opacity:"show"},i.openingspeed)}}else{if(a>=1){e(u).insertAfter(e(this)).css({display:"none",top:a}).animate({opacity:"show"},i.openingspeed)}else{e(u).insertAfter(e(this)).css({display:"none",top:0}).animate({opacity:"show"},i.openingspeed)}}if(i.pushdirectionleft===true){if(i.autoScroll===true){if(a>=1){o.delay(i.scrollSpeed).css({right:-(t-i.spacing)}).animate({right:0,opacity:"show",width:t-i.spacing},i.openingspeed)}else{o.css({right:-(t-i.spacing)}).animate({right:0,opacity:"show",width:t-i.spacing},i.openingspeed)}}else{if(a>=1){o.css({right:-(t-i.spacing),top:a}).animate({right:0,opacity:"show",width:t-i.spacing},i.openingspeed)}else{o.css({right:-(t-i.spacing),top:0}).animate({right:0,opacity:"show",width:t-i.spacing},i.openingspeed)}}}else{if(i.autoScroll===true){o.delay(i.scrollSpeed).css({left:-(t-i.spacing)}).animate({left:0,opacity:"show",width:t-i.spacing},i.openingspeed)}else{if(a>=1){o.css({left:-(t-i.spacing),top:a}).animate({left:0,opacity:"show",width:t-i.spacing},i.openingspeed)}else{o.css({left:-(t-i.spacing),top:0}).animate({left:0,opacity:"show",width:t-i.spacing},i.openingspeed)}}}s.animate({width:t},i.openingspeed);return false}}}else{if(o.length>0&&!o.is(":visible")){console.log("Open Subnav");var f=e("."+c).scrollTop();e(this).parent().addClass(g);s.addClass(m);s.siblings().addClass(m);if(e(r).find("ul").is(":visible")){e(r).addClass(v)}if(i.autoScroll===true){if(f>=1){e("."+c).animate({scrollTop:0},i.scrollSpeed)}}if(i.autoScroll===true){if(f>=1){e(u).delay(i.scrollSpeed).insertAfter(e(this)).css("display","none").animate({opacity:"show"},i.openingspeed)}else{e(u).insertAfter(e(this)).css("display","none").animate({opacity:"show"},i.openingspeed)}}else{if(f>=1){e(u).insertAfter(e(this)).css({display:"none",top:f}).animate({opacity:"show"},i.openingspeed)}else{e(u).insertAfter(e(this)).css({display:"none",top:0}).animate({opacity:"show"},i.openingspeed)}}if(i.pushdirectionleft===true){if(i.autoScroll===true){if(f>=1){o.delay(i.scrollSpeed).css({right:-(t-i.spacing)}).animate({right:0,opacity:"show",width:t-i.spacing},i.openingspeed)}else{o.css({right:-(t-i.spacing)}).animate({right:0,opacity:"show",width:t-i.spacing},i.openingspeed)}}else{if(f>=1){o.css({right:-(t-i.spacing),top:f}).animate({right:0,opacity:"show",width:t-i.spacing},i.openingspeed)}else{o.css({right:-(t-i.spacing),top:0}).animate({right:0,opacity:"show",width:t-i.spacing},i.openingspeed)}}}else{if(i.autoScroll===true){o.delay(i.scrollSpeed).css({left:-(t-i.spacing)}).animate({left:0,opacity:"show",width:t-i.spacing},i.openingspeed)}else{if(f>=1){o.css({left:-(t-i.spacing),top:f}).animate({left:0,opacity:"show",width:t-i.spacing},i.openingspeed)}else{o.css({left:-(t-i.spacing),top:0}).animate({left:0,opacity:"show",width:t-i.spacing},i.openingspeed)}}}return false}}})}})}})(jQuery)
  
  