Added some more Javascript behavior to edit version of custom forms.
This commit is contained in:
parent
d255909f3b
commit
40990255c7
1 changed files with 15 additions and 0 deletions
|
@ -257,6 +257,16 @@ var customForm = {
|
||||||
default: { fn = this.doEditFormCombinedView; break; }
|
default: { fn = this.doEditFormCombinedView; break; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Remember the original org. If we click the add new org link
|
||||||
|
// but then cancel out of it, we want to restore this value.
|
||||||
|
this.originalOrg = this.existingSelect.val();
|
||||||
|
// But we only want to restore the original value from when the
|
||||||
|
// form loaded. If we've already changed to a new value, we don't
|
||||||
|
// want to restore that.
|
||||||
|
this.existingSelect.bind('change', function() {
|
||||||
|
customForm.originalOrg = null;
|
||||||
|
});
|
||||||
|
|
||||||
fn.call(customForm);
|
fn.call(customForm);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -357,6 +367,11 @@ var customForm = {
|
||||||
customForm.button.val(customForm.defaultButtonText);
|
customForm.button.val(customForm.defaultButtonText);
|
||||||
customForm.doAddNewLinkForCombinedView();
|
customForm.doAddNewLinkForCombinedView();
|
||||||
customForm.setReturnView(customForm.views.COMBINED);
|
customForm.setReturnView(customForm.views.COMBINED);
|
||||||
|
|
||||||
|
if (customForm.originalOrg) {
|
||||||
|
customForm.existingSelect.val(customForm.originalOrg);
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Reference in a new issue