You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ja...@apache.org on 2010/12/29 16:18:22 UTC

svn commit: r1053649 - /ofbiz/trunk/framework/images/webapp/images/getDependentDropdownValues.js

Author: jaz
Date: Wed Dec 29 15:18:21 2010
New Revision: 1053649

URL: http://svn.apache.org/viewvc?rev=1053649&view=rev
Log:
fixed issue with getDependentDropdownValues; when the returned list contains only a single item (in Safari) the indexOf method is undefined; changed code to use jQuery.inArray instead

Modified:
    ofbiz/trunk/framework/images/webapp/images/getDependentDropdownValues.js

Modified: ofbiz/trunk/framework/images/webapp/images/getDependentDropdownValues.js
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/getDependentDropdownValues.js?rev=1053649&r1=1053648&r2=1053649&view=diff
==============================================================================
--- ofbiz/trunk/framework/images/webapp/images/getDependentDropdownValues.js (original)
+++ ofbiz/trunk/framework/images/webapp/images/getDependentDropdownValues.js Wed Dec 29 15:18:21 2010
@@ -48,8 +48,7 @@ function getDependentDropdownValues(requ
         type: 'POST',
         success: function(result){
             list = result[responseName];
-            // Create and show dependent select options
-            // Create and show dependent select options
+            // Create and show dependent select options            
             if (list) {
                 jQuery.each(list, function(key, value){
                     if (typeof value == 'string') {
@@ -69,7 +68,7 @@ function getDependentDropdownValues(requ
                 })
             };
             // Hide/show the dependent drop-down if hide=true else simply disable/enable
-            if ((!list) || (list.length < 1) || ((list.length == 1) && list[0].indexOf("_NA_") >= 0)) {
+            if ((!list) || (list.length < 1) || ((list.length == 1) && jQuery.inArray("_NA_", list) != -1)) {
                 jQuery(target).attr('disabled', 'disabled');
                 if (hide) {
                     if (jQuery(target).is(':visible')) {