mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
28 lines
514 B
JavaScript
28 lines
514 B
JavaScript
import $ from 'jQuery';
|
|
|
|
$.entwine('ss', function($){
|
|
|
|
$('.memberdatetimeoptionset').entwine({
|
|
onmatch: function() {
|
|
this.find('.toggle-content').hide();
|
|
this._super();
|
|
}
|
|
});
|
|
|
|
$('.memberdatetimeoptionset .toggle').entwine({
|
|
onclick: function(e) {
|
|
e.preventDefault();
|
|
|
|
var content = $(this).closest('.form__field-description').parent()
|
|
.find('.toggle-content');
|
|
|
|
if(content.is(":visible")) {
|
|
content.hide();
|
|
} else {
|
|
content.show();
|
|
}
|
|
}
|
|
});
|
|
|
|
});
|