$(".sidebar-tabs > li > a").on("click",function(){var a=$(this).closest("li"),s=a.closest(".sidebar"),e=s.find(".sidebar-tabs"),i=s.find(".sidebar-content");a.hasClass("active")?(e.children("li.active").removeClass("active"),s.addClass("collapsed")):(i.children(".sidebar-pane.active").removeClass("active"),i.children(this.hash).addClass("active"),e.children("li.active").removeClass("active"),a.addClass("active"),s.hasClass("collapsed")&&s.removeClass("collapsed"))});
$.fn.sidebar=function(){var e=this,s=e.children(".sidebar-tabs").first(),i=e.children(".sidebar-content").first();return e.find(".sidebar-tabs > li > a").on("click",function(){var s=$(this).closest("li");s.hasClass("active")?e.close():e.open(this.hash.slice(1),s)}),e.open=function(a,l){"undefined"==typeof l&&(l=s.find('li > a[href="#'+a+'"]').parent()),i.children(".sidebar-pane.active").removeClass("active"),i.children("#"+a).addClass("active"),s.children("li.active").removeClass("active"),l.addClass("active"),e.trigger("content",{id:a}),e.hasClass("collapsed")&&(e.trigger("opening"),e.removeClass("collapsed"))},e.close=function(){s.children("li.active").removeClass("active"),e.hasClass("collapsed")||(e.trigger("closing"),e.addClass("collapsed"))},e};
Update minified file