diff --git a/productMods/edit/forms/css/customForm.css b/productMods/edit/forms/css/customForm.css index 1bc3d96b..d81f9a69 100644 --- a/productMods/edit/forms/css/customForm.css +++ b/productMods/edit/forms/css/customForm.css @@ -100,7 +100,6 @@ option { #content form a.close:link, #content form a.close:visited { - /*display: none; Hide if Javascript disabled. Javascript will show. */ border-color: #FF7700; color: #FF7700; } diff --git a/productMods/edit/forms/js/customForm.js b/productMods/edit/forms/js/customForm.js index f5ce0755..19984c23 100644 --- a/productMods/edit/forms/js/customForm.js +++ b/productMods/edit/forms/js/customForm.js @@ -82,7 +82,6 @@ var customForm = { this.returnViewField = $("input[name='view']"); this.cancel = this.form.find('.cancel'); - this.close = this.form.find('.close'); // Read values used to control display this.editType = $("input[name='editType']").val(); @@ -94,7 +93,7 @@ var customForm = { }, // On page load, make changes to the non-Javascript version for the Javascript version. - // These are features that will NOT CHANGE throughout the workflow of the Javascript version.. + // These are features that will NOT CHANGE throughout the workflow of the Javascript version. adjustForJs: function() { var selectExistingLabel = $('.existing label'); @@ -103,6 +102,17 @@ var customForm = { this.existingOrNew.hide(); this.toggleRequiredHints('show', this.addNew); + + // The close link in the addNew div closes the addNew div and restores the + // combined view. It is needed for the one-step add form and the edit form + // (which is a one-step form), but not for the two-step add form, since we'd + // want it to restore step 1, but the Cancel link at the bottom of the form + // already performs that function. + if (this.formSteps == 1) { + this.addNew.prepend('cancel'); + } + this.close = this.form.find('.close'); + }, initForm: function() { @@ -337,8 +347,6 @@ var customForm = { doClose: function() { - if (customForm.formSteps > 1) { return; } - customForm.close.unbind('click'); customForm.close.bind('click', function() { // RY When we have multiple existing and addNew divs, we won't @@ -348,8 +356,9 @@ var customForm = { customForm.addNewLink.show(); customForm.button.val(customForm.defaultButtonText); customForm.doAddNewLinkForCombinedView(); + customForm.setReturnView(customForm.views.COMBINED); return false; - }); + }); }, // Return true iff there are validation errors on the form diff --git a/productMods/edit/forms/personHasEducationalBackground.jsp b/productMods/edit/forms/personHasEducationalBackground.jsp index adbb9455..4153f16d 100644 --- a/productMods/edit/forms/personHasEducationalBackground.jsp +++ b/productMods/edit/forms/personHasEducationalBackground.jsp @@ -375,9 +375,7 @@ the org type still gets asserted. --%>
diff --git a/productMods/edit/forms/personHasPositionHistory.jsp b/productMods/edit/forms/personHasPositionHistory.jsp index f8fce601..fcfb15b7 100644 --- a/productMods/edit/forms/personHasPositionHistory.jsp +++ b/productMods/edit/forms/personHasPositionHistory.jsp @@ -281,6 +281,7 @@ if (objectUri != null) { // editing existing entry %>