silverstripe-framework/javascript/TogglePanel.js

14 lines
352 B
JavaScript
Raw Normal View History

Behaviour.register({
'h2.TogglePanelHeader' : {
onclick : function() {
var contentDiv = $('panel_' + this.id);
if(contentDiv.style.display == 'none') {
contentDiv.style.display = '';
Element.removeClassName(this, 'closed');
} else {
contentDiv.style.display = 'none';
Element.addClassName(this, 'closed');
}
}
}
});