(function() {
this.BsCollapsablePanel = (function() {
function BsCollapsablePanel(panel_class) {
if (panel_class == null) {
panel_class = '.panel-heading span.collapsable';
}
$(panel_class).click(function(e) {
var $this;
$this = $(this);
$this.parents('.panel').find('.panel-body').collapse('toggle');
return $this.find('i').toggleClass('glyphicon-chevron-down glyphicon-chevron-up');
});
}
return BsCollapsablePanel;
})();
}).call(this);
new BsCollapsablePanel(); // optionnaly you can pass the class/id of the button in your panel that move the body