1
0
mirror of https://github.com/silverstripe/silverstripe-framework synced 2024-10-22 14:05:37 +02:00
silverstripe-framework/javascript/ToggleField.js

13 lines
322 B
JavaScript

var field = $('div.toggleField');
if(field.hasClass('startClosed')) {
field.find('div.contentMore').hide();
field.find('div.contentLess').show();
}
$('div.toggleField .triggerLess, div.toggleField .triggerMore').click(function() {
field.find('div.contentMore').toggle();
field.find('div.contentLess').toggle();
});