]> git.mjollnir.org Git - moodle.git/commitdiff
Modified a bit the child iterator that wasn't working under Safari.
authorstronk7 <stronk7>
Wed, 24 Jan 2007 19:39:59 +0000 (19:39 +0000)
committerstronk7 <stronk7>
Wed, 24 Jan 2007 19:39:59 +0000 (19:39 +0000)
Tested with FF and Safari. Needs test with IE.

lib/javascript-static.js

index cb09d37c0c008b54e8914bacbca73ae7c1c6bf58..caec82b2016f469246dc8d3329b8b09d6cb5af47 100644 (file)
@@ -206,9 +206,9 @@ function findParentNode(el, elName, elClass, elId) {
 */
 function findChildNodes(start, tagName, elementClass, elementID, elementName) {
     var children = new Array();
-    for (var childIndex in start.childNodes) {
+    for (var i = 0; i < start.childNodes.length; i++) {
         var classfound = false;
-        var child = start.childNodes[childIndex];
+        var child = start.childNodes[i];
         if((child.nodeType == 1) &&//element node type
                   (elementClass && (typeof(child.className)=='string'))){
             var childClasses = child.className.split(/\s+/);