[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kupu-checkins
Subject:    [kupu-checkins] r55400 - kupu/trunk/kupu/common
From:       guido () codespeak ! net
Date:       2008-05-29 15:55:01
Message-ID: 20080529155501.BEB3F1684E9 () codespeak ! net
[Download RAW message or body]

Author: guido
Date: Thu May 29 17:55:00 2008
New Revision: 55400

Modified:
   kupu/trunk/kupu/common/kupuhelpers.js
   kupu/trunk/kupu/common/kuputoolcollapser.js
Log:
Fixed some problems in NodeIterator, fixed exception in kuputoolcollapser if
elements didn't have a class name set.


Modified: kupu/trunk/kupu/common/kupuhelpers.js
==============================================================================
--- kupu/trunk/kupu/common/kupuhelpers.js	(original)
+++ kupu/trunk/kupu/common/kupuhelpers.js	Thu May 29 17:55:00 2008
@@ -327,10 +327,10 @@
             this.current = current.firstChild;
         } else {
             // walk up parents until we finish or find one with a nextSibling
-            while (current != this.terminator && !current.nextSibling) {
+            while (current !== this.terminator && !current.nextSibling) {
                 current = current.parentNode;
             };
-            if (current == this.terminator) {
+            if (current === this.terminator) {
                 this.current = false;
             } else {
                 this.current = current.nextSibling;
@@ -620,6 +620,9 @@
             if (currnode.nodeType == 3) {
                 offset += currnode.nodeValue.length;
             };
+            while (!currnode.nextSibling) {
+                currnode = currnode.parentNode;
+            };
             currnode = currnode.nextSibling;
         };
         return offset + startnodeoffset;

Modified: kupu/trunk/kupu/common/kuputoolcollapser.js
==============================================================================
--- kupu/trunk/kupu/common/kuputoolcollapser.js	(original)
+++ kupu/trunk/kupu/common/kuputoolcollapser.js	Thu May 29 17:55:00 2008
@@ -20,7 +20,7 @@
         };
         for (var i=0; i < this.parent.childNodes.length; i++) {
             var child = this.parent.childNodes[i];
-            if (child.className.match(/\bkupu-toolbox\b/)) {
+            if (child.className && child.className.match(/\bkupu-toolbox\b/)) {
                 var heading = child.getElementsByTagName('h1')[0];
                 if (!heading) {
                     throw('heading not found by collapser for toolbox ' +
_______________________________________________
kupu-checkins mailing list
kupu-checkins@codespeak.net
http://codespeak.net/mailman/listinfo/kupu-checkins
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic