From 38f021251a0c2bbddd7ec08335385006d7cc3514 Mon Sep 17 00:00:00 2001 From: nac26 Date: Sun, 6 Feb 2011 01:44:24 +0000 Subject: [PATCH] NIHVIVO-1603 Using jQuery in place of DWR to return the moniker selection experience to its former glory --- webapp/web/js/edit/entityRetry.js | 25 ++++++++++++++++++- .../templates/edit/specific/entity_retry.jsp | 8 +++--- 2 files changed, 28 insertions(+), 5 deletions(-) diff --git a/webapp/web/js/edit/entityRetry.js b/webapp/web/js/edit/entityRetry.js index 4bf490e1c..f105d8a2f 100644 --- a/webapp/web/js/edit/entityRetry.js +++ b/webapp/web/js/edit/entityRetry.js @@ -331,4 +331,27 @@ function fillList(id, data, selectedtext) { return [curleft,curtop]; } --> - + + // ------------------------------------------------------------------------------- + // Using jQuery to step in for DWR and provide original moniker selection behavior + // ------------------------------------------------------------------------------- + var monikerSelection = { + // onChange event listener for moniker select list + monikerListener: function() { + $('#Moniker').change(function() { + // alert('The moniker has changed'); + // if "[new moniker]" is selected, then enable the alt field + if ( $('#Moniker option:selected').text() == "[new moniker]" ) { + $('#MonikerSelectAlt').removeAttr('disabled'); + } else { + $('#MonikerSelectAlt').val(''); + $('#MonikerSelectAlt').attr('disabled', 'disabled'); + } + }); + } + } + + $(document).ready(function() { + monikerSelection.monikerListener(); + }); + \ No newline at end of file diff --git a/webapp/web/templates/edit/specific/entity_retry.jsp b/webapp/web/templates/edit/specific/entity_retry.jsp index d2b132363..22fdf29d3 100644 --- a/webapp/web/templates/edit/specific/entity_retry.jsp +++ b/webapp/web/templates/edit/specific/entity_retry.jsp @@ -1,5 +1,5 @@ -<%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%> - +<%-- $This file is distributed under the terms of the license in /doc/license.txt$ --%> + <%@ taglib prefix="form" uri="http://vitro.mannlib.cornell.edu/edit/tags" %> @@ -7,7 +7,7 @@ Individual Name
" maxlength="255" />

- + @@ -32,7 +32,7 @@ If [new moniker] is selected, enter here:
- "/> + " disabled="disabled" /> otherwise leave this field blank