NIHVIVO-193. Work on custom form for person has position history. Generalized css and javascript to work with other custom forms that will be built for version 1.0 (see NIHVIVO-141).
This commit is contained in:
parent
1b4b52954d
commit
3f09ddf7d2
6 changed files with 484 additions and 94 deletions
42
productMods/edit/forms/js/customForm.js
Normal file
42
productMods/edit/forms/js/customForm.js
Normal file
|
@ -0,0 +1,42 @@
|
|||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
||||
|
||||
var customForm = {
|
||||
|
||||
onLoad: function() {
|
||||
|
||||
var button = $('#submit');
|
||||
var addNewLink = $('#addNewLink');
|
||||
var existing = $('#existing');
|
||||
var addNew = $('#new');
|
||||
var entry = $('#entry');
|
||||
var editType = $("input[name='editType']").val();
|
||||
var entryType = $("input[name='entryType']").val();
|
||||
|
||||
if (editType == 'add') {
|
||||
// Set up form for step 1
|
||||
addNewLink.show();
|
||||
addNew.hide();
|
||||
entry.hide();
|
||||
button.val('Continue');
|
||||
|
||||
// Add event listeners
|
||||
button.bind('click', function() {
|
||||
entry.show();
|
||||
addNewLink.hide();
|
||||
$(this).val('Create ' + entryType);
|
||||
$(this).unbind('click');
|
||||
return false;
|
||||
|
||||
});
|
||||
} else { // editing existing entry
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
$(document).ready(function(){
|
||||
customForm.onLoad();
|
||||
});
|
|
@ -1,14 +1,2 @@
|
|||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
||||
|
||||
var personHasPositionHistory = {
|
||||
|
||||
onLoad: function() {
|
||||
$("#newOrg").hide();
|
||||
$("#position").hide();
|
||||
$("#submit").val("Continue");
|
||||
}
|
||||
};
|
||||
|
||||
$(document).ready(function(){
|
||||
personHasPositionHistory.onLoad();
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue