NIHVIVO-646 Using Javascript on page rather than hidden divs to pass information to the addAuthorsForm Javascript. Fix problems in DataPropertyComparator that were causing errors to be thrown on the page when no xsd datatype defined for an authorship rank.
This commit is contained in:
parent
b8cf560daa
commit
57a8cdcbe8
7 changed files with 34 additions and 36 deletions
|
@ -13,6 +13,9 @@ var addAuthorForm = {
|
|||
mixIn: function() {
|
||||
// Mix in the custom form utility methods
|
||||
vitro.utils.borrowMethods(vitro.customFormUtils, this);
|
||||
|
||||
// Get the custom form data from the page
|
||||
$.extend(this, customFormData);
|
||||
},
|
||||
|
||||
// On page load, create references for easy access to form elements.
|
||||
|
@ -157,8 +160,7 @@ var addAuthorForm = {
|
|||
|
||||
// Make cache a property of this so we can access it after removing
|
||||
// an author.
|
||||
this.acCache = {};
|
||||
this.baseAcUrl = $('.acUrl').attr('id');
|
||||
this.acCache = {};
|
||||
this.setAcUrl();
|
||||
|
||||
$('#lastName').autocomplete({
|
||||
|
@ -260,8 +262,8 @@ var addAuthorForm = {
|
|||
// Reorder authors. Called on page load and after author drag-and-drop.
|
||||
// Event and ui parameters are defined only in the case of drag-and-drop.
|
||||
reorderAuthors: function(event, ui) {
|
||||
var predicateUri = '<' + $('.rankPred').attr('id') + '>',
|
||||
rankXsdType = $('.rankXsdType').attr('id'),
|
||||
var predicateUri = '<' + this.rankPred + '>',
|
||||
rankXsdType = this.rankXsdType,
|
||||
additions = '',
|
||||
retractions = '',
|
||||
authorships = [];
|
||||
|
@ -305,7 +307,7 @@ var addAuthorForm = {
|
|||
// console.log('retractions: ' + retractions);
|
||||
|
||||
$.ajax({
|
||||
url: $('.reorderUrl').attr('id'),
|
||||
url: addAuthorForm.reorderUrl,
|
||||
data: {
|
||||
additions: additions,
|
||||
retractions: retractions
|
||||
|
|
|
@ -13,6 +13,9 @@ var customForm = {
|
|||
mixIn: function() {
|
||||
// Mix in the custom form utility methods
|
||||
vitro.utils.borrowMethods(vitro.customFormUtils, this);
|
||||
|
||||
// Get the custom form data from the page
|
||||
$.extend(this, customFormData);
|
||||
},
|
||||
|
||||
// On page load, create references for easy access to form elements.
|
||||
|
@ -39,8 +42,6 @@ var customForm = {
|
|||
this.acSelector = this.form.find('.acSelector');
|
||||
this.acSelection = this.form.find('.acSelection');
|
||||
this.acReceiver = this.form.find('.acReceiver');
|
||||
|
||||
$.extend(this, customFormData);
|
||||
|
||||
},
|
||||
|
||||
|
@ -49,7 +50,7 @@ var customForm = {
|
|||
|
||||
if (!this.typeSelector.length) {
|
||||
this.formSteps = 1;
|
||||
// there's also going to be a 3-step form
|
||||
// there's also going to be a 3-step form - look for this.subTypeSelector
|
||||
} else {
|
||||
this.formSteps = 2;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue