(function(a,f,g,d){'use strict';var b='doubleTapToGo',e={automatic:!0,selectorClass:'doubletap',selectorChain:'li:has(ul)'};function c(c,d){this.element=c,this.settings=a.extend({},e,d),this._defaults=e,this._name=b,this.init()}a.extend(c.prototype,{preventClick:!1,currentTap:a(),init:function(){a(this.element).on('touchstart','.'+this.settings.selectorClass,this._tap.bind(this)).on('click','.'+this.settings.selectorClass,this._click.bind(this)).on('remove',this._destroy.bind(this)),this._addSelectors()},_addSelectors:function(){if(this.settings.automatic!==!0)return;a(this.element).find(this.settings.selectorChain).addClass(this.settings.selectorClass)},_click:function(b){this.preventClick?b.preventDefault():this.currentTap=a()},_tap:function(c){var b=a(c.target).closest('li');if(!b.hasClass(this.settings.selectorClass)){this.preventClick=!1;return}if(b.get(0)===this.currentTap.get(0)){this.preventClick=!1;return}this.preventClick=!0,this.currentTap=b,c.stopPropagation()},_destroy:function(){a(this.element).off()},reset:function(){this.currentTap=a()}}),a.fn[b]=function(e){var g=arguments,f;if(e===d||typeof e=='object')return this.each(function(){a.data(this,b)||a.data(this,b,new c(this,e))});if(typeof e=='string'&&e[0]!=='_'&&e!=='init')return this.each(function(){var d=a.data(this,b),h=e==='destroy'?'_destroy':e;d instanceof c&&typeof d[h]=='function'&&(f=d[h].apply(d,Array.prototype.slice.call(g,1))),e==='destroy'&&a.data(this,b,null)}),f!==d?f:this}})(jQuery,window,document)