/*! simpler-sidebar - A simple side nav in jQuery * @version 2.2.5 * @link https://github.com/simple-sidebar/simpler-sidebar * @copyright 2015 - 2018 Davide Di Criscito (https://github.com/dcdeiv) * @license MIT AND GPL-2.0 */ !function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof module&&module.exports?module.exports=function(n,o){return void 0===o&&(o="undefined"!=typeof window?require("jquery"):require("jquery")(n)),e(o),o}:e(jQuery)}(function(q){q.fn.simplerSidebar=function(n){var I=q.extend(!0,{attr:"simplersidebar",top:0,gap:64,zIndex:3e3,sidebar:{width:300},animation:{duration:500,easing:"swing"},events:{on:{animation:{open:function(){},close:function(){},both:function(){}}},callbacks:{animation:{open:function(){},close:function(){},both:function(){},freezePage:!0}}},mask:{display:!0,css:{backgroundColor:"black",opacity:.5,filter:"Alpha(opacity=50)"}}},n);return this.each(function(){var n,o,e,t="data-"+I.attr,i="opened"===I.init?"opened":"closed",a=I.overflow?I.overflow:q("html").css("overflow"),s=I.overflow?I.overflow:q("body").css("overflow"),c="left"===I.align?"left":"right",d=I.animation.duration,r=I.animation.easing,l={},f=!0===I.events.callbacks.animation.freezePage,u=function(){q("body, html").css("overflow","hidden")},p=q(this),m=function(n){return n").attr(t,"mask"),v=q(I.selectors.trigger),y=I.selectors.quitter?I.selectors.quitter:"a",k=q(window).width(),g={animation:{open:function(){w.fadeIn(d),h("opened"),I.events.on.animation.open()},close:function(){w.fadeOut(d),h("closed"),I.events.on.animation.close()},both:function(){I.events.on.animation.both()}}},x={animation:{open:function(){f&&u(),I.events.callbacks.animation.open()},close:function(){f&&(q("html").css("overflow",a),q("body").css("overflow",s)),I.events.callbacks.animation.close()},both:function(){I.events.callbacks.animation.both()}}},z=function(){l[c]=-p.width(),p.animate(l,d,r,function(){x.animation.close(),x.animation.both()}),g.animation.close(),g.animation.both()};(n={position:"fixed",top:parseInt(I.top),bottom:0,width:m(k),zIndex:I.zIndex})[c]="closed"===i?-m(k):0,f&&"opened"===i&&u(),p.css(n).attr(t,i),(o={position:"fixed",top:parseInt(I.top),right:0,bottom:0,left:0,zIndex:I.zIndex-1,display:"none"}).display="opened"===i?"block":"none",e=q.extend(!0,o,I.mask.css),I.mask.display&&w.appendTo("body").css(e),v.click(function(){switch(b()){case"opened":z();break;case"closed":l[c]=0,p.animate(l,d,r,function(){x.animation.open(),x.animation.both()}),g.animation.open(),g.animation.both()}}),w.click(z),p.on("click",y,z),q(window).resize(function(){var n=q(window).width();p.css("width",m(n)),"closed"===b()&&p.css(c,-p.width())})})}});