incubator-xap-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmarga...@apache.org
Subject svn commit: r529876 - /incubator/xap/trunk/codebase/src/xap/bridges/basic/XInclude.js
Date Wed, 18 Apr 2007 05:31:19 GMT
Author: jmargaris
Date: Tue Apr 17 22:31:19 2007
New Revision: 529876

URL: http://svn.apache.org/viewvc?view=rev&rev=529876
Log:
remvoe the old include tag before adding the new content,
this fixes some IE issues. IE was strange, with the old code
would see BOTH insertBefore calls from two different include tags
before EITHER of the removeChild calls (the next line) which
doesn't make any sense at all

Modified:
    incubator/xap/trunk/codebase/src/xap/bridges/basic/XInclude.js

Modified: incubator/xap/trunk/codebase/src/xap/bridges/basic/XInclude.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/codebase/src/xap/bridges/basic/XInclude.js?view=diff&rev=529876&r1=529875&r2=529876
==============================================================================
--- incubator/xap/trunk/codebase/src/xap/bridges/basic/XInclude.js (original)
+++ incubator/xap/trunk/codebase/src/xap/bridges/basic/XInclude.js Tue Apr 17 22:31:19 2007
@@ -83,10 +83,9 @@
 	  		//TODO what about fragments? Should we handle that? spec allows it with
 	  		//xpointer, kind of ugly...
 		}
-		
-		//insert before us then remove us!
-		thisElement.parentNode.insertBefore(newChild, thisElement);
+		var index = thisElement.parentNode.indexOfChild(thisElement);
 		thisElement.parentNode.removeChild(thisElement);
+		thisElement.parentNode.insertChildAt(index, newChild);
 	}
 	catch(e){	
 		this.getSession().handleException(new xap.util.Exception("Error loading xinclude with href
" + this.getElement().getAttribute("href"), e));



Mime
View raw message