2019-03-30 23:04:15 -04:00
|
|
|
|
$(document).ready(function() {
|
|
|
|
|
$.each($('.has-related-content'), function (key, value) {
|
|
|
|
|
value = $(value);
|
2019-04-11 21:43:05 -04:00
|
|
|
|
if (value.attr('checked') !== undefined && value.attr('checked').length > 0) {
|
2019-03-30 23:04:15 -04:00
|
|
|
|
$(value.data('related-content')).slideDown();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$('input:checkbox').change(function () {
|
|
|
|
|
var isChecked = $(this).is(':checked');
|
|
|
|
|
isChecked ? $($(this).data('related-content')).slideDown() : $($(this).data('related-content')).slideUp();
|
|
|
|
|
});
|
2019-04-11 21:43:05 -04:00
|
|
|
|
|
|
|
|
|
$('.configuration-add-new').click(function (e) {
|
|
|
|
|
e.preventDefault();
|
2019-04-14 11:55:05 -04:00
|
|
|
|
|
2019-04-11 21:43:05 -04:00
|
|
|
|
let parentElement = $(this).parent();
|
|
|
|
|
|
|
|
|
|
$.get($(this).attr('href') + '&itemCount=' + $(this).siblings().length, function (response) {
|
2019-04-14 11:55:05 -04:00
|
|
|
|
$(response).insertBefore(parentElement.children().last());
|
2019-04-11 21:43:05 -04:00
|
|
|
|
});
|
|
|
|
|
});
|
2019-03-30 23:04:15 -04:00
|
|
|
|
});
|