NIHVIVO-1024 Custom form Javascript bug fixes
This commit is contained in:
parent
45b1545b3a
commit
762a32045e
2 changed files with 15 additions and 10 deletions
|
@ -145,7 +145,12 @@ var customForm = {
|
||||||
// autocomplete type can be determined. If a type selection has been made,
|
// autocomplete type can be determined. If a type selection has been made,
|
||||||
// unhide the acSelector field.
|
// unhide the acSelector field.
|
||||||
} else if (this.typeSelector.length) {
|
} else if (this.typeSelector.length) {
|
||||||
this.typeSelector.val() ? this.acSelectorWrapper.show() : this.acSelectorWrapper.hide();
|
if (this.typeSelector.val()) {
|
||||||
|
this.acSelectorWrapper.show()
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
this.acSelectorWrapper.hide();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -183,8 +188,8 @@ var customForm = {
|
||||||
customForm.undoAutocompleteSelection();
|
customForm.undoAutocompleteSelection();
|
||||||
|
|
||||||
// If no selection, go back to type view. This prevents problems like trying to run autocomplete
|
// If no selection, go back to type view. This prevents problems like trying to run autocomplete
|
||||||
// or submitting form without a type selection. Exception: if formSteps == 1 (e.g., a one-step form,
|
// or submitting form without a type selection. Exceptions: (1) a one-step form; (2) a two-step
|
||||||
// or a two-step form in repair editMode) stay in full view, else we lose the role information.
|
// form in repair mode, so we don't lose the other data in the form.
|
||||||
(typeVal.length || customForm.formSteps === 1) ? customForm.initFormFullView() : customForm.initFormTypeView();
|
(typeVal.length || customForm.formSteps === 1) ? customForm.initFormFullView() : customForm.initFormTypeView();
|
||||||
|
|
||||||
});
|
});
|
||||||
|
@ -321,8 +326,9 @@ var customForm = {
|
||||||
this.acSelectorWrapper.hide();
|
this.acSelectorWrapper.hide();
|
||||||
//this.acSelector.attr('disabled', 'disabled');
|
//this.acSelector.attr('disabled', 'disabled');
|
||||||
|
|
||||||
// If only one form step, type is pre-selected, and the label is coded in the html.
|
// If form has a type selector, add type name to label. If form has no type selector,
|
||||||
if (this.formSteps > 1) {
|
// type name is coded into the html.
|
||||||
|
if (this.typeSelector.length) {
|
||||||
this.acSelection.find('label').html('Selected ' + this.typeName + ':');
|
this.acSelection.find('label').html('Selected ' + this.typeName + ':');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -207,10 +207,9 @@ core:dateTimePrecision (DateTimeValue : DateTimeValuePrecision)
|
||||||
"predicate" : ["predicate", "${predicateUriJson}" ],
|
"predicate" : ["predicate", "${predicateUriJson}" ],
|
||||||
"object" : ["edTraining", "${objectUriJson}", "URI" ],
|
"object" : ["edTraining", "${objectUriJson}", "URI" ],
|
||||||
|
|
||||||
"n3required" : [ "${n3ForNewEdTraining}", "${majorFieldAssertion}" ],
|
"n3required" : [ "${n3ForNewEdTraining}", "${majorFieldAssertion}", "${orgLabelAssertion}", "${orgTypeAssertion}" ],
|
||||||
|
|
||||||
"n3optional" : [ "${n3ForEdTrainingToOrg}",
|
"n3optional" : [ "${n3ForEdTrainingToOrg}",
|
||||||
"${orgLabelAssertion}", "${orgTypeAssertion}",
|
|
||||||
"${degreeAssertion}", "${deptAssertion}", "${infoAssertion}", "${yearAssertion}" ],
|
"${degreeAssertion}", "${deptAssertion}", "${infoAssertion}", "${yearAssertion}" ],
|
||||||
|
|
||||||
"newResources" : { "edTraining" : "${defaultNamespace}",
|
"newResources" : { "edTraining" : "${defaultNamespace}",
|
||||||
|
@ -282,7 +281,7 @@ core:dateTimePrecision (DateTimeValue : DateTimeValuePrecision)
|
||||||
},
|
},
|
||||||
"orgLabel" : {
|
"orgLabel" : {
|
||||||
"newResource" : "false",
|
"newResource" : "false",
|
||||||
"validators" : [ ],
|
"validators" : [ "nonempty" ],
|
||||||
"optionsType" : "UNDEFINED",
|
"optionsType" : "UNDEFINED",
|
||||||
"literalOptions" : [ ],
|
"literalOptions" : [ ],
|
||||||
"predicateUri" : "",
|
"predicateUri" : "",
|
||||||
|
@ -293,7 +292,7 @@ core:dateTimePrecision (DateTimeValue : DateTimeValuePrecision)
|
||||||
},
|
},
|
||||||
"orgType" : {
|
"orgType" : {
|
||||||
"newResource" : "false",
|
"newResource" : "false",
|
||||||
"validators" : [ ],
|
"validators" : [ "nonempty" ],
|
||||||
"optionsType" : "CHILD_VCLASSES",
|
"optionsType" : "CHILD_VCLASSES",
|
||||||
"literalOptions" : [ "Select one" ],
|
"literalOptions" : [ "Select one" ],
|
||||||
"predicateUri" : "",
|
"predicateUri" : "",
|
||||||
|
|
Loading…
Add table
Reference in a new issue