NIHVIVO-647 Add name attribute to vitro custom jsp input tag so that the name can differ from the id.
Removed flag1value1 stuff from all vivo custom forms, since no longer needed. Initial setup for publication form javascript.
This commit is contained in:
parent
9b219635a5
commit
95380454af
9 changed files with 93 additions and 72 deletions
|
@ -15,7 +15,7 @@ var addAuthorForm = {
|
|||
vitro.utils.borrowMethods(vitro.customFormUtils, this);
|
||||
},
|
||||
|
||||
// On page load, create references within the addAuthorForm scope to DOM elements.
|
||||
// On page load, create references for easy access to form elements.
|
||||
// NB These must be assigned after the elements have been loaded onto the page.
|
||||
initObjects: function() {
|
||||
|
||||
|
|
|
@ -68,7 +68,7 @@ var customForm = {
|
|||
vitro.utils.borrowMethods(vitro.customFormUtils, this);
|
||||
},
|
||||
|
||||
// On page load, create references within the customForm scope to DOM elements.
|
||||
// On page load, create references for easy access to form elements.
|
||||
// NB These must be assigned after the elements have been loaded onto the page.
|
||||
initObjects: function() {
|
||||
|
||||
|
|
|
@ -1,2 +1,81 @@
|
|||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
||||
|
||||
var customFormWATS = {
|
||||
|
||||
/* *** Initial page setup *** */
|
||||
|
||||
onLoad: function() {
|
||||
this.mixIn();
|
||||
this.initObjects();
|
||||
this.initPage();
|
||||
},
|
||||
|
||||
mixIn: function() {
|
||||
// Mix in the custom form utility methods
|
||||
vitro.utils.borrowMethods(vitro.customFormUtils, this);
|
||||
},
|
||||
|
||||
// On page load, create references for easy access to form elements.
|
||||
// NB These must be assigned after the elements have been loaded onto the page.
|
||||
initObjects: function(){
|
||||
|
||||
this.form = $('#content form');
|
||||
this.button = $('#submit');
|
||||
this.or = $('span.or');
|
||||
this.requiredLegend = $('#requiredLegend');
|
||||
|
||||
this.typeSelector = this.form.find('.typeSelector');
|
||||
this.acInput = this.form.find('.acInput');
|
||||
this.acSelection = this.form.find('.acSelection');
|
||||
this.cancel = this.form.find('cancel');
|
||||
|
||||
},
|
||||
|
||||
// Set up the form on page load
|
||||
initPage: function() {
|
||||
|
||||
this.initFormTypeView();
|
||||
this.bindEventListeners();
|
||||
this.initAutocomplete();
|
||||
|
||||
},
|
||||
|
||||
initFormTypeView: function() {
|
||||
|
||||
this.button.hide();
|
||||
this.or.hide();
|
||||
this.requiredLegend.hide();
|
||||
|
||||
this.cancel.unbind('click');
|
||||
this.cancel('click', function() {
|
||||
|
||||
});
|
||||
},
|
||||
|
||||
initFormFullView: function() {
|
||||
|
||||
this.button.show();
|
||||
this.or.show();
|
||||
this.requiredLegend.show();
|
||||
|
||||
this.cancel.unbind('click');
|
||||
this.cancel('click', function() {
|
||||
|
||||
});
|
||||
},
|
||||
|
||||
// Bind event listeners that apply to all form views
|
||||
bindEventListeners: function() {
|
||||
|
||||
},
|
||||
|
||||
initAutocomplete: function() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
$(document).ready(function() {
|
||||
customFormWATS.onLoad();
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue