!function(e){"use strict";"function"==typeofdefine&&define.amd?define(["jquery"],e):"object"==typeofexports?module.exports=e(require("jquery")):e(jQuery)}(function(e){"use strict";vart=void0!==document.ontouchstart,s={init:function(t){returnt=e.extend({iscroll:{mouseWheel:!0,preventDefault:!1},showOverlay:!0},t),s.settings={state:!1,events:{opened:"drawer.opened",closed:"drawer.closed"},dropdownEvents:{opened:"shown.bs.dropdown",closed:"hidden.bs.dropdown"}},s.settings.class=e.extend({nav:"drawer-nav",toggle:"drawer-toggle",overlay:"drawer-overlay",open:"drawer-open",close:"drawer-close",dropdown:"drawer-dropdown"},t.class),this.each(function(){varn=this,r=e(this);r.data("drawer")||(t=e.extend({},t),r.data("drawer",{options:t}),s.refresh.call(n),t.showOverlay&&s.addOverlay.call(n),e("."+s.settings.class.toggle).on("click.drawer",function(){returns.toggle.call(n),n.iScroll.refresh()}),e(window).on("resize.drawer",function(){returns.close.call(n),n.iScroll.refresh()}),e("."+s.settings.class.dropdown).on(s.settings.dropdownEvents.opened+" "+s.settings.dropdownEvents.closed,function(){returnn.iScroll.refresh()}))})},refresh:function(){this.iScroll=newIScroll("."+s.settings.class.nav,e(this).data("drawer").options.iscroll)},addOverlay:function(){vart=e(this),n=e("<div>").addClass(s.settings.class.overlay+" "+s.settings.class.toggle);returnt.append(n)},toggle:function(){vare=this;returns.settings.state?s.close.call(e):s.open.call(e)},open:function(){varn=e(this);returnt&&n.on("touchmove.drawer",function(e){e.preventDefault()}),n.removeClass(s.settings.class.close).addClass(s.settings.class.open).drawerCallback(function(){s.settings.state=!0,n.trigger(s.settings.events.opened)})},close:function(){varn=e(this);returnt&&n.off("touchmove.drawer"),n.removeClass(s.settings.class.open).addClass(s.settings.class.close).drawerCallback(function(){s.settings.state=!1,n.trigger(s.settings.events.closed)})},destroy:function(){returnthis.each(function(){vart=this,n=e(this);e("."+s.settings.class.toggle).off("click.drawer"),e(window).off("resize.drawer"),e("."+s.settings.class.dropdown).off(s.settings.dropdownEvents.opened+" "+s.settings.dropdownEvents.closed),t.iScroll.destroy(),n.removeData("drawer").find("."+s.settings.class.overlay).remove()})}};e.fn.drawerCallback=function(t){vars="transitionend webkitTransitionEnd";returnthis.each(function(){varn=e(this);n.on(s,function(){returnn.off(s),t.call(this)})})},e.fn.drawer=function(t){returns[t]?s[t].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeoft&&t?voide.error("Method "+t+" does not exist on jQuery.drawer"):s.init.apply(this,arguments)}});