NIHVIVO-193 On step 1 of position history form, don't show Continue button. Instead, bind the event listener that opens the rest of the form to a selection from the org drop-down.
This commit is contained in:
parent
f2a9ddd219
commit
5f428364a2
1 changed files with 13 additions and 5 deletions
|
@ -66,12 +66,14 @@ var customForm = {
|
|||
|
||||
this.form = $('#content form');
|
||||
this.button = $('#submit');
|
||||
this.or = $('span.or');
|
||||
this.requiredLegend = $('#requiredLegend');
|
||||
|
||||
// These may need to be changed to classes rather than ids, if there are
|
||||
// multiple sets of divs to show/hide during the workflow.
|
||||
this.addNewLink = $('.addNewLink');
|
||||
this.existing = $('.existing');
|
||||
this.existingSelect = this.existing.children('select');
|
||||
this.addNew = $('.new');
|
||||
this.entry = $('.entry');
|
||||
this.existingOrNew = $('.existingOrNew');
|
||||
|
@ -149,12 +151,14 @@ var customForm = {
|
|||
customForm.addNew.hide();
|
||||
customForm.entry.hide();
|
||||
customForm.requiredLegend.hide();
|
||||
customForm.button.val('Continue');
|
||||
customForm.button.hide(); customForm.or.hide();
|
||||
|
||||
// Assign event listeners
|
||||
customForm.button.bind('click', function() {
|
||||
customForm.doAddFormStep2(customForm.views.SELECT_EXISTING);
|
||||
return false;
|
||||
customForm.existingSelect.bind('change', function() {
|
||||
if ($(this).val() != '') {
|
||||
customForm.doAddFormStep2(customForm.views.SELECT_EXISTING);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
// Note that addNewLink event listener is different
|
||||
// in different views.
|
||||
|
@ -178,6 +182,9 @@ var customForm = {
|
|||
}
|
||||
|
||||
fn.call(customForm);
|
||||
|
||||
customForm.button.show();
|
||||
customForm.or.show();
|
||||
},
|
||||
|
||||
// Most methods below use 'customForm' rather than 'this', because 'this' doesn't reference
|
||||
|
@ -259,6 +266,7 @@ var customForm = {
|
|||
customForm.button.unbind('click');
|
||||
customForm.addNewLink.unbind('click');
|
||||
customForm.close.unbind('click');
|
||||
customForm.existingSelect.unbind('change');
|
||||
},
|
||||
|
||||
clearFormData: function() {
|
||||
|
|
Loading…
Add table
Reference in a new issue