You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jl...@apache.org on 2012/07/28 14:47:12 UTC

svn commit: r1366662 - in /ofbiz/branches/release11.04: ./ framework/images/webapp/images/getDependentDropdownValues.js

Author: jleroux
Date: Sat Jul 28 12:47:12 2012
New Revision: 1366662

URL: http://svn.apache.org/viewvc?rev=1366662&view=rev
Log:
"Applied fix from trunk for revision: 1366660" 
------------------------------------------------------------------------
r1366660 | jleroux | 2012-07-28 14:46:22 +0200 (sam., 28 juil. 2012) | 1 line

While working on OFBIZ-4978, I changed for getDependentDropdownValues.js to load values unselected instead of loading them all selected one by one, then only the last being selected. This was actually a bug and I already wondered why the list had the last option selected by default instead of the 1st. This fixes this last aspect.
------------------------------------------------------------------------


Modified:
    ofbiz/branches/release11.04/   (props changed)
    ofbiz/branches/release11.04/framework/images/webapp/images/getDependentDropdownValues.js

Propchange: ofbiz/branches/release11.04/
------------------------------------------------------------------------------
  Merged /ofbiz/trunk:r1366660

Modified: ofbiz/branches/release11.04/framework/images/webapp/images/getDependentDropdownValues.js
URL: http://svn.apache.org/viewvc/ofbiz/branches/release11.04/framework/images/webapp/images/getDependentDropdownValues.js?rev=1366662&r1=1366661&r2=1366662&view=diff
==============================================================================
--- ofbiz/branches/release11.04/framework/images/webapp/images/getDependentDropdownValues.js (original)
+++ ofbiz/branches/release11.04/framework/images/webapp/images/getDependentDropdownValues.js Sat Jul 28 12:47:12 2012
@@ -52,7 +52,7 @@ function getDependentDropdownValues(requ
                 jQuery.each(list, function(key, value){
                     if (typeof value == 'string') {
                         values = value.split(': ');
-                        if (values[1].indexOf(selected) >= 0) {
+                        if (values[1].indexOf(selected) >= 0 && selected.length > 0) {
                             optionList += "<option selected='selected' value = " + values[1] + " >" + values[0] + "</option>";
                         } else {
                             optionList += "<option value = " + values[1] + " >" + values[0] + "</option>";