felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r750550 - /felix/trunk/webconsole/src/main/resources/res/ui/configmanager.js
Date Thu, 05 Mar 2009 18:55:49 GMT
Author: cziegeler
Date: Thu Mar  5 18:55:47 2009
New Revision: 750550

URL: http://svn.apache.org/viewvc?rev=750550&view=rev
Log:
SLING-975 : Fix multi-values in all browsers.

Modified:
    felix/trunk/webconsole/src/main/resources/res/ui/configmanager.js

Modified: felix/trunk/webconsole/src/main/resources/res/ui/configmanager.js
URL: http://svn.apache.org/viewvc/felix/trunk/webconsole/src/main/resources/res/ui/configmanager.js?rev=750550&r1=750549&r2=750550&view=diff
==============================================================================
--- felix/trunk/webconsole/src/main/resources/res/ui/configmanager.js (original)
+++ felix/trunk/webconsole/src/main/resources/res/ui/configmanager.js Thu Mar  5 18:55:47
2009
@@ -220,9 +220,9 @@
         }
         else
         {
-            for (var vidx in attr.values)
+            for (var i=0;i<attr.values.length;i++)
             {
-                tdEl.appendChild( createSpan( prop, attr.values[vidx], attr.type ) );
+                tdEl.appendChild( createSpan( prop, attr.values[i], attr.type ) );
             }
         }
         
@@ -301,17 +301,25 @@
     spanCounter++;
     var newId = prop + spanCounter;
     
+    var addButton = createElement("input", "input",
+    		{   type: "button",
+    	        style: {width : "5%"},
+    	        value: "+"
+    	    }
+      );
+    $(addButton).click(function() {addValue(prop, newId)});
+    var remButton = createElement("input", "input",
+    		{   type: "button",
+    	        style: {width : "5%"},
+    	        value: "-"
+    	    }
+      );
+    $(remButton).click(function() {removeValue(newId)});
     var spanEl = createElement( "span", null, { id: newId }, [
-        createInput( prop, value, type, '89%' )
+        createInput( prop, value, type, '89%' ), addButton, remButton,
+        createElement("br")
     ]);
     
-    // define this SPAN as innerHTML otherwise the onClick event handler
-    // of the buttons is not accepted by IE...    
-    var innerHTML = "<input type='button' class='input' style='width:\"5%\"' value='+'
onClick='addValue(\"" + prop + "\", \"" + newId + "\")' />";
-    innerHTML += "<input type='button' class='input' style='width:\"5%\"' value='-' onClick='removeValue(\""
+ newId + "\")' />";
-    innerHTML += "<br />";
-    spanEl.innerHTML += innerHTML;
-    
     return spanEl;
 }
 
@@ -368,7 +376,6 @@
     	return selectEl;
         
     } else { // Simple 
-    
         return createElement( "input", "input", {
                 type: "text",
                 name: prop,



Mime
View raw message