myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From we...@apache.org
Subject svn commit: r982533 - /myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_Dom.js
Date Thu, 05 Aug 2010 10:19:56 GMT
Author: werpu
Date: Thu Aug  5 10:19:56 2010
New Revision: 982533

URL: http://svn.apache.org/viewvc?rev=982533&view=rev
Log:
https://issues.apache.org/jira/browse/MYFACES-2859

Modified:
    myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_Dom.js

Modified: myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_Dom.js
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_Dom.js?rev=982533&r1=982532&r2=982533&view=diff
==============================================================================
--- myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_Dom.js
(original)
+++ myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_Dom.js
Thu Aug  5 10:19:56 2010
@@ -307,17 +307,17 @@ myfaces._impl.core._Runtime.singletonExt
         if (!evalNodesDefined) {
             throw new Error("replaceElements called while evalNodes is not an array");
         }
-        var oldNode = item;
+        var sibling = item.nextSibling;
         var resultArr = this._Lang.objToArray(evalNodes);
 
         for (var cnt = 0; cnt < resultArr.length; cnt++) {
             if (cnt == 0) {
-                oldNode = parentNode.replaceChild(resultArr[cnt], oldNode);
+                parentNode.replaceChild(resultArr[cnt], item);
             } else {
-                if (oldNode.nextSibling) {
-                    oldNode = parentNode.insertBefore(resultArr[cnt], oldNode.nextSibling);
+                if (sibling) {
+                    parentNode.insertBefore(resultArr[cnt], sibling);
                 } else {
-                    oldNode = parentNode.appendChild(resultArr[cnt]);
+                    parentNode.appendChild(resultArr[cnt]);
 
                 }
             }



Mime
View raw message