diff templates/classic/html/help_controls.js @ 3043:3f3ca882deb2

fix "(list)" popup when list is one item long [SF#1064716]
author Richard Jones <richard@users.sourceforge.net>
date Tue, 04 Jan 2005 01:07:09 +0000
parents 10a49678ebf2
children 18def94e5150
line wrap: on
line diff
--- a/templates/classic/html/help_controls.js	Tue Jan 04 00:54:58 2005 +0000
+++ b/templates/classic/html/help_controls.js	Tue Jan 04 01:07:09 2005 +0000
@@ -15,21 +15,33 @@
 }
 
 function determineList() {
-    // generate a comma-separated list of the checked items
-    var list = new String('');
-    for (box=0; box < document.frm_help.check.length; box++) {
-        if (document.frm_help.check[box].checked) {
-            if (list.length == 0) {
-                separator = '';
-            }
-            else {
-                separator = ',';
-            }
-            // we used to use an Array and push / join, but IE5.0 sux
-            list = list + separator + document.frm_help.check[box].value;
-        }
-    }
-    return list;
+     // generate a comma-separated list of the checked items
+     var list = new String('');
+ 
+     // either a checkbox object or an array of checkboxes
+     var check = document.frm_help.check;
+ 
+     if ((check.length == undefined) && (check.checked != undefined)) {
+         // only one checkbox on page
+         if (check.checked) {
+             list = check.value;
+         }
+     } else {
+         // array of checkboxes
+         for (box=0; box < check.length; box++) {
+             if (check[box].checked) {
+                 if (list.length == 0) {
+                     separator = '';
+                 }
+                 else {
+                     separator = ',';
+                 }
+                 // we used to use an Array and push / join, but IE5.0 sux
+                 list = list + separator + check[box].value;
+             }
+         }
+     }
+     return list;  
 }
 
 function updateList() {

Roundup Issue Tracker: http://roundup-tracker.org/