|
|
@ -253,6 +253,7 @@ $(function () { |
|
|
reveal_class: "child-item-row", |
|
|
reveal_class: "child-item-row", |
|
|
customAction: function(settings, newElement) { |
|
|
customAction: function(settings, newElement) { |
|
|
$('.children-questions').show(); |
|
|
$('.children-questions').show(); |
|
|
|
|
|
enableChildrenFooterNav({page:'edit'}); |
|
|
|
|
|
|
|
|
// Want the second list row because that is before the newElement
|
|
|
// Want the second list row because that is before the newElement
|
|
|
// was appended.
|
|
|
// was appended.
|
|
|
@ -318,6 +319,7 @@ $(function () { |
|
|
$('.children-questions').show(); |
|
|
$('.children-questions').show(); |
|
|
$('.children-list').hide(); |
|
|
$('.children-list').hide(); |
|
|
$('.fact-sheets').hide(); |
|
|
$('.fact-sheets').hide(); |
|
|
|
|
|
enableChildrenFooterNav({page:'edit'}); |
|
|
|
|
|
|
|
|
$('[type=radio]').prop('checked', false); |
|
|
$('[type=radio]').prop('checked', false); |
|
|
|
|
|
|
|
|
@ -392,24 +394,35 @@ $(function () { |
|
|
} |
|
|
} |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
$('.child-item-row').on('click', populateChildInputFields); |
|
|
|
|
|
$('#btn_save_child').on('click', function(e) { |
|
|
|
|
|
e.preventDefault(); |
|
|
|
|
|
|
|
|
var returnToParent = function(options) { |
|
|
$('.children-questions').hide(); |
|
|
$('.children-questions').hide(); |
|
|
$('.children-list').show(); |
|
|
$('.children-list').show(); |
|
|
|
|
|
|
|
|
var childrenData = []; |
|
|
|
|
|
// The hidden row is the first now so make sure to skip it.
|
|
|
|
|
|
$('#claimant_children').find('tbody:first').find('tr:gt(0)').each(function() { |
|
|
|
|
|
var childData = {}; |
|
|
|
|
|
$(this).find('.child-field').each(function() { |
|
|
|
|
|
childData[$(this).attr('data-target-form-field')] = $(this).text(); |
|
|
|
|
|
|
|
|
enableChildrenFooterNav({page:'review'}); |
|
|
|
|
|
|
|
|
|
|
|
if (options !== undefined && options.persist) { |
|
|
|
|
|
var childrenData = []; |
|
|
|
|
|
// The hidden row is the first row so make sure to skip it.
|
|
|
|
|
|
$('#claimant_children').find('tbody:first').find('tr:gt(0)').each(function () { |
|
|
|
|
|
var childData = {}; |
|
|
|
|
|
$(this).find('.child-field').each(function () { |
|
|
|
|
|
childData[$(this).attr('data-target-form-field')] = $(this).text(); |
|
|
|
|
|
}); |
|
|
|
|
|
childrenData.push(childData); |
|
|
}); |
|
|
}); |
|
|
childrenData.push(childData); |
|
|
|
|
|
}); |
|
|
|
|
|
var jsonChildrenData = JSON.stringify(childrenData); |
|
|
|
|
|
ajaxCall($(this).prop('name'), jsonChildrenData); |
|
|
|
|
|
|
|
|
var jsonChildrenData = JSON.stringify(childrenData); |
|
|
|
|
|
ajaxCall($(this).prop('name'), jsonChildrenData); |
|
|
|
|
|
} |
|
|
populateChildrenFactSheets(); |
|
|
populateChildrenFactSheets(); |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
$('.child-item-row').on('click', populateChildInputFields); |
|
|
|
|
|
$('#btn_save_child').on('click', function(e) { |
|
|
|
|
|
e.preventDefault(); |
|
|
|
|
|
returnToParent({persist: true}); |
|
|
|
|
|
}); |
|
|
|
|
|
$('#btn_revert_child').on('click', function(e) { |
|
|
|
|
|
e.preventDefault(); |
|
|
|
|
|
returnToParent({persist: false}); |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
$('#claimant_children').each(function(){ |
|
|
$('#claimant_children').each(function(){ |
|
|
@ -574,6 +587,17 @@ $(function () { |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
var enableChildrenFooterNav = function(page) { |
|
|
|
|
|
if (page.page === 'edit') { |
|
|
|
|
|
$('#children_review_buttons').hide(); |
|
|
|
|
|
$('#child_edit_buttons').show(); |
|
|
|
|
|
} else if (page.page === 'review') { |
|
|
|
|
|
$('#children_review_buttons').show(); |
|
|
|
|
|
$('#child_edit_buttons').hide(); |
|
|
|
|
|
} |
|
|
|
|
|
window.scrollTo(0, 0); |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
var saveListControlRow = function(tableId) { |
|
|
var saveListControlRow = function(tableId) { |
|
|
var payload = []; |
|
|
var payload = []; |
|
|
var saveSelector = $(this).attr('data-save_select'); |
|
|
var saveSelector = $(this).attr('data-save_select'); |
|
|
|