1var slidebars=function(){var e=$("[canvas]"),n={},t=!1,u=!1,o=["top","right","bottom","left"],s=["reveal","push","overlay","shift"],f=function(t){var i=$(),r="0px, 0px",u=parseFloat(n[t].element.css("transitionDuration"),10)*1e3;return(n[t].style==="reveal"||n[t].style==="push"||n[t].style==="shift")&&(i=i.add(e)),(n[t].style==="push"||n[t].style==="overlay"||n[t].style==="shift")&&(i=i.add(n[t].element)),n[t].active&&(n[t].side==="top"?r="0px, "+n[t].element.css("height"):n[t].side==="right"?r="-"+n[t].element.css("width")+", 0px":n[t].side==="bottom"?r="0px, -"+n[t].element.css("height"):n[t].side==="left"&&(r=n[t].element.css("width")+", 0px")),{elements:i,amount:r,duration:u}},h=function(t,r,u,f){if(i(t))throw"Error registering Slidebar, a Slidebar with id '"+t+"' already exists.";n[t]={id:t,side:r,style:u,element:f,active:!1}},i=function(t){return n.hasOwnProperty(t)?!0:!1},r;this.init=function(n){if(t)throw"Slidebars has already been initialized.";u||($("[off-canvas]").each(function(){var n=$(this).attr("off-canvas").split(" ",3);if(!n||!n[0]||o.indexOf(n[1])===-1||s.indexOf(n[2])===-1)throw"Error registering Slidebar, please specifiy a valid id, side and style'.";h(n[0],n[1],n[2],$(this))}),u=!0);t=!0;this.css();$(r).trigger("init");typeof n=="function"&&n()};this.exit=function(n){if(!t)throw"Slidebars hasn't been initialized.";var i=function(){t=!1;$(r).trigger("exit");typeof n=="function"&&n()};this.getActiveSlidebar()?this.close(i):i()};this.css=function(u){var f,e;if(!t)throw"Slidebars hasn't been initialized.";for(f in n)i(f)&&(e=n[f].side==="top"||n[f].side==="bottom"?n[f].element.css("height"):n[f].element.css("width"),(n[f].style==="push"||n[f].style==="overlay"||n[f].style==="shift")&&n[f].element.css("margin-"+n[f].side,"-"+e));this.getActiveSlidebar()&&this.open(this.getActiveSlidebar());$(r).trigger("css");typeof u=="function"&&u()};this.open=function(u,e){if(!t)throw"Slidebars hasn't been initialized.";if(!u||!i(u))throw"Error opening Slidebar, there is no Slidebar with id '"+u+"'.";var o=function(){n[u].active=!0;n[u].element.css("display","block");$(r).trigger("opening",[n[u].id]);var t=f(u);t.elements.css({"transition-duration":t.duration+"ms",left:"255px"});setTimeout(function(){$(r).trigger("opened",[n[u].id]);typeof e=="function"&&e()},t.duration)};this.getActiveSlidebar()&&this.getActiveSlidebar()!==u?this.close(o):o()};this.close=function(u,e){if(typeof u=="function"&&(e=u,u=null),!t)throw"Slidebars hasn't been initialized.";if(u&&!i(u))throw"Error closing Slidebar, there is no Slidebar with id '"+u+"'.";if(u||(u=this.getActiveSlidebar()),u&&n[u].active){n[u].active=!1;$(r).trigger("closing",[n[u].id]);var o=f(u);o.elements.css("left","");setTimeout(function(){o.elements.css("transition-duration","");n[u].element.css("display","");$(r).trigger("closed",[n[u].id]);typeof e=="function"&&e()},o.duration)}};this.toggle=function(r,u){if(!t)throw"Slidebars hasn't been initialized.";if(!r||!i(r))throw"Error toggling Slidebar, there is no Slidebar with id '"+r+"'.";n[r].active?this.close(r,function(){typeof u=="function"&&u()}):this.open(r,function(){typeof u=="function"&&u()})};this.isActive=function(){return t};this.isActiveSlidebar=function(r){if(!t)throw"Slidebars hasn't been initialized.";if(!r)throw"You must provide a Slidebar id.";if(!i(r))throw"Error retrieving Slidebar, there is no Slidebar with id '"+r+"'.";return n[r].active};this.getActiveSlidebar=function(){var u,r;if(!t)throw"Slidebars hasn't been initialized.";u=!1;for(r in n)if(i(r)&&n[r].active){u=n[r].id;break}return u};this.getSlidebars=function(){var r,u;if(!t)throw"Slidebars hasn't been initialized.";r=[];for(u in n)i(u)&&r.push(n[u].id);return r};this.getSlidebar=function(r){if(!t)throw"Slidebars hasn't been initialized.";if(!r)throw"You must pass a Slidebar id.";if(!r||!i(r))throw"Error retrieving Slidebar, there is no Slidebar with id '"+r+"'.";return n[r]};this.events={};r=this.events;$(window).on("resize",this.css.bind(this))}; 2/* 3//# sourceMappingURL=slidebars.min.js.map 4*/
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.