Browse Source

DIV-933 - Step 6 - Children details- Save and Return button doesn't save

pull/160/head
Michael Olund 6 years ago
parent
commit
3b2778b8db
2 changed files with 17 additions and 7 deletions
  1. +16
    -6
      edivorce/apps/core/static/js/main.js
  2. +1
    -1
      edivorce/apps/core/templates/question/06_children_your_children.html

+ 16
- 6
edivorce/apps/core/static/js/main.js View File

@ -381,12 +381,7 @@ $(function () {
evaluateFactSheetShowCriteria(childrenData);
};
var returnToParent = function(options) {
$('.children-questions').hide();
$('.children-list').show();
enableChildrenFooterNav({page:'review'});
var saveChildQuestions = function(options) {
if (options !== undefined && options.persist) {
var childrenData = [];
// The hidden row is the first row so make sure to skip it.
@ -400,6 +395,13 @@ $(function () {
var jsonChildrenData = JSON.stringify(childrenData);
ajaxCall('claimant_children', jsonChildrenData);
}
};
var returnToParent = function(options) {
$('.children-questions').hide();
$('.children-list').show();
enableChildrenFooterNav({page:'review'});
saveChildQuestions(options);
populateChildrenFactSheets();
};
@ -409,6 +411,14 @@ $(function () {
e.preventDefault();
returnToParent({persist: true});
});
$('#btn_save_child_return_later').on('click', function(e) {
e.preventDefault();
saveChildQuestions({persist: true});
window.location.href = $(this).attr('href');
});
$('#btn_revert_child').on('click', function(e) {
e.preventDefault();
returnToParent({persist: false});


+ 1
- 1
edivorce/apps/core/templates/question/06_children_your_children.html View File

@ -305,7 +305,7 @@
<div id="child_edit_buttons" class="form-buttons clearfix" hidden>
<a class="btn btn-primary" id="btn_revert_child" href="#"><i class="fa fa-arrow-circle-o-left"></i>&nbsp;&nbsp;&nbsp;Back</a>
<a class="btn btn-success pull-right" id="btn_save_child" name="claimant_children" href="#">Save changes&nbsp;&nbsp;&nbsp;<i class="fa fa-floppy-o"></i></a>
<a class="btn btn-primary pull-right save-spinner" href="{% url 'overview' %}"><i class="fa fa-floppy-o"></i>&nbsp;&nbsp;&nbsp;Save and return later</a>
<a class="btn btn-primary pull-right id="btn_save_child_return_later save-spinner" id="btn_save_child_return_later" href="{% url 'overview' %}"><i class="fa fa-floppy-o"></i>&nbsp;&nbsp;&nbsp;Save and return later</a>
</div>
{% endblock %}


Loading…
Cancel
Save