adium 2764:3627dfff7c3f: Insert into the DOM if we're consecutiv...

commits at adium.im commits at adium.im
Thu Oct 22 21:35:19 UTC 2009


details:	http://hg.adium.im/adium/rev/3627dfff7c3f
revision:	2764:3627dfff7c3f
author:		Stephen Holt <sholt at adium.im>
date:		Thu Oct 22 17:35:06 2009 -0400

Insert into the DOM if we're consecutive, append to the end if we're not.

diffs (23 lines):

diff -r 747f096da367 -r 3627dfff7c3f Plugins/WebKit Message View/Template.html
--- a/Plugins/WebKit Message View/Template.html	Thu Oct 22 16:20:47 2009 -0400
+++ b/Plugins/WebKit Message View/Template.html	Thu Oct 22 17:35:06 2009 -0400
@@ -30,11 +30,14 @@
 			
 			function outputHTML() {
 				var insert = document.getElementById("insert");
-				if(insert)
-					insert.parentNode.removeChild(insert);
-				
-				// insert the documentFragment into the live DOM
-				document.getElementById("Chat").appendChild(self.fragment);
+				if(insert && self.isConsecutive) {
+					insert.parentNode.replaceChild(self.fragment, insert);
+				} else {
+					if(insert)
+						insert.parentNode.removeChild(insert);
+					// insert the documentFragment into the live DOM
+					document.getElementById("Chat").appendChild(self.fragment);
+				}
 				alignChat(self.shouldScroll);
 				
 				// reset state to empty/non-coalescing




More information about the commits mailing list