// generated by coffeescript 1.6.1 /* flexnav.js 0.7 copyright 2013, jason weaver http://jasonweaver.name released under the wtfpl license http://sam.zoy.org/wtfpl/ // */(function(){$.fn.flexnav=function(e){var t,n,r,i,s,o;o=$.extend({animationspeed:100},e);t=$(this);i=!1;r=!1;t.find("li").each(function(){if($(this).has("ul").length)return $(this).addclass("item-with-ul").find("ul").hide()});t.data("breakpoint")&&(n=t.data("breakpoint"));s=function(){if($(window).width()<=n){t.removeclass("lg-screen").addclass("sm-screen");$(".one-page li a").on("click",function(){return t.removeclass("show")});return $(".item-with-ul").off()}t.removeclass("sm-screen").addclass("lg-screen");t.removeclass("show");return $(".item-with-ul").on("mouseenter",function(){return $(this).find(">ul").addclass("show").stop(!0,!0).slidedown(o.animationspeed)}).on("mouseleave",function(){return $(this).find(">ul").removeclass("show").stop(!0,!0).slideup(o.animationspeed)})};$(".item-with-ul, .menu-button").append('');$(".menu-button, .menu-button .touch-button").on("touchstart mousedown",function(e){e.preventdefault();e.stoppropagation();console.log(r);return $(this).on("touchmove mousemove",function(e){var t;t=e.pagex;r=!0;return $(window).off("touchmove mousemove")})}).on("touchend mouseup",function(e){var n;e.preventdefault();e.stoppropagation();r=!1;n=$(this).parent();r===!1&&console.log("clicked");if(i===!1){t.addclass("show");return i=!0}if(i===!0){t.removeclass("show");return i=!1}});$(".touch-button").on("touchstart mousedown",function(e){e.stoppropagation();e.preventdefault();return $(this).on("touchmove mousemove",function(e){r=!0;return $(window).off("touchmove mousemove")})}).on("touchend mouseup",function(e){var n;e.preventdefault();e.stoppropagation();n=$(this).parent(".item-with-ul").find(">ul");t.hasclass("lg-screen")===!0&&$(this).parent(".item-with-ul").siblings().find("ul.show").removeclass("show").hide();if(n.hasclass("show")===!0)return n.removeclass("show").slideup(o.animationspeed);if(n.hasclass("show")===!1)return n.addclass("show").slidedown(o.animationspeed)});$(".item-with-ul *").focus(function(){$(this).parent(".item-with-ul").parent().find(".open").not(this).removeclass("open").hide();return $(this).parent(".item-with-ul").find(">ul").addclass("open").show()});s();return $(window).on("resize",s)}}).call(this);