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();
|
|
|
|
|
//let totalItems = $(this).siblings().length;
|
|
|
|
|
//let inputHtml = $(this).siblings().last().get(0).outerHTML;
|
|
|
|
|
//inputHtml = inputHtml.replace('_' + totalItems - 1 + '_', '_' + totalItems + '_');
|
|
|
|
|
//inputHtml = inputHtml.replace('[' + totalItems - 1 + ']', '[' + totalItems + ']');
|
|
|
|
|
//$(this).parent().prepend(inputHtml);
|
|
|
|
|
|
|
|
|
|
let parentElement = $(this).parent();
|
|
|
|
|
|
|
|
|
|
$.get($(this).attr('href') + '&itemCount=' + $(this).siblings().length, function (response) {
|
|
|
|
|
parentElement.prepend(response);
|
|
|
|
|
});
|
|
|
|
|
});
|
2019-03-30 23:04:15 -04:00
|
|
|
|
});
|