'use strict'

; (function(win, mobutil) {

	var manager = {};
	
	var CONST_DRAWER_CLASS = ".drawer"; // multiple elements allowed

	function getElement(el_id)
	{
		return win.document.querySelector(el_id);
	}
	
	function getElements(sel)
	{
		return win.document.querySelectorAll(sel);
	}
	
	manager.clear = function(evt)
	{
		var drawer = evt.target;
		if (drawer === null) return;

		drawer.classList.remove("visible");
		drawer.classList.remove("flyoff");

		drawer.removeEventListener(
			'animationend',
			manager.clear,
			false);
		drawer.removeEventListener(
			'webkitAnimationEnd',
			manager.clear,
			false);
	}
	
	function bindListeners()
	{	
		var drawers = getElements(CONST_DRAWER_CLASS);
		for (var i=0, len=drawers.length; i<len; i++)
		{
			var drawer = drawers[i];
			bindOpen(drawer);
			bindClose(drawer);
			bindMenuToggle(drawer);
		}
	}
	function bindMenuToggle(drawer)
	{
		var toggle_selector = drawer.getAttribute("data-toggle-selector");
		if (toggle_selector === null)
		{
			return;
		}
		var toggles = getElements(toggle_selector);
		if (toggles.length === 0)
		{
			return;
		}
		
		var callback = function(evt)
		{
			drawer.classList.toggle('visible');
		}
		for (var i=0, len=toggles.length; i<len; i++)
		{
			toggles[i].addEventListener('click', callback);
		}
	}
	function bindOpen(drawer)
	{
		var swipe_target_selector = drawer.getAttribute("data-swipe-target");
		if (swipe_target_selector === null) return;
		
		var swipe_target = getElement(swipe_target_selector);
		if (swipe_target === null) return;

		var in_dir = drawer.getAttribute("data-slide-in-dir");
		
		var callback = function(evt, opts)
		{
			if (opts === null || opts.target_drawer === null) 
			{
				return;
			}
			var drawer = opts.target_drawer;
			drawer.classList.add('visible');
		}
		
		var swipeHandler = new mobutil.swipeHandler({
			element: swipe_target,
			opts: { 'target_drawer' : drawer },
			callback: callback,
			direction: in_dir,
			distance: 80
		});
	}
	function bindClose(drawer)
	{
		var out_dir = drawer.getAttribute("data-slide-out-dir");
		
		var callback = function(evt, opts)
		{
			if (opts === null || opts.target_drawer === null) 
			{
				return;
			}
			var drawer = opts.target_drawer;
			drawer.classList.add('flyoff');

			drawer.addEventListener(
				'animationend',
				manager.clear,
				false);
			drawer.addEventListener(
				'webkitAnimationEnd',
				manager.clear,
				false);
		}

		var swipeHandler = new mobutil.swipeHandler({
			element: drawer,
			opts: { 'target_drawer' : drawer },
			callback: callback,
			direction: out_dir,
			distance: 80
		});
	}
	
	bindListeners();

})(this, mobutil);
@@ -24,23 +24,28 @@
 on(win, 
-mobutil
+swipeHandler
 ) %7B%0A%0A%09va
@@ -830,28 +830,24 @@
 er);%0A%09%09%09bind
-Menu
 Toggle(drawe
@@ -875,12 +875,8 @@
 bind
-Menu
 Togg
@@ -1175,24 +1175,49 @@
 'visible');%0A
+%09%09%09evt.preventDefault();%0A
 %09%09%7D%0A%09%09for (v
@@ -2668,10 +2668,23 @@
  mobutil
+.swipeHandler
 );

Add preventdefault to toggle (and rename bind function from bindMenuToggle to bindToggle). Pass swipeHandler in rather than the swipeHandler namespace