Commit 1f1fa325 authored by Pat Kira's avatar Pat Kira Committed by Robert Lyon
Browse files

Correct button text when resume form is collapsed (bug: 1465107)

- After submitting one of the resume forms, the collapsible
button should set to add
- Focus on the add button after the form is submitted (temporary fix)

behatnotneeded

Change-Id: I0745b6639c55ac0bdf0412640ef73080603e6832
parent 6ca0ade3
......@@ -960,16 +960,26 @@ var tableRenderers = {};
function compositeSaveCallback(form, data) {
key = form.id.substr(3);
tableRenderers[key].doupdate();
\$j( '#' + key + 'form').removeClass('in');
//toggleCompositeForm(key);
// Can't reset() the form here, because its values are what were just submitted,
// thanks to pieforms
forEach(form.elements, function(element) {
if (hasElementClass(element, 'text') || hasElementClass(element, 'textarea')) {
element.value = '';
}
\$j('#' + form.id + ' input:text, #' + form.id + ' textarea').each(function() {
\$j(this).attr('value', '');
});
\$j('#' + key + 'form').collapse('hide');
tableRenderers[key].doupdate();
\$j('#add' + key + 'button').focus();
// Do a double check to make sure the formchange checker for the submitted form is actually reset
tableRenderers[key].postupdatecallback = function(response) {
var checkers = formchangemanager.formcheckers;
for (var i=0; i < checkers.length; i ++) {
if (checkers[i].id == form.id) {
checkers[i].state = FORM_INIT;
}
}
}
formSuccess(form, data);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment