/pidgin/main: 1da63a04d506: Make sure the selection anchor is re...

Elliott Sales de Andrade qulogic at pidgin.im
Mon Jul 9 02:50:23 EDT 2012


Changeset: 1da63a04d506f8657b9c937cec97cc40f64c45f5
Author:	 Elliott Sales de Andrade <qulogic at pidgin.im>
Date:	 2012-07-08 23:49 -0400
Branch:	 default
URL: http://hg.pidgin.im/pidgin/main/rev/1da63a04d506

Description:

Make sure the selection anchor is removed.

diffstat:

 pidgin/gtkwebview.c |  7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diffs (17 lines):

diff --git a/pidgin/gtkwebview.c b/pidgin/gtkwebview.c
--- a/pidgin/gtkwebview.c
+++ b/pidgin/gtkwebview.c
@@ -570,8 +570,11 @@
 		"var s = window.getSelection();"
 		"var r = document.createRange();"
 		"var n = document.getElementById('caret');"
-		"r.setStartBefore(n);"
-		"r.setEndBefore(n);"
+		"r.selectNodeContents(n);"
+		"var f = r.extractContents();"
+		"r.selectNode(n);"
+		"r.insertNode(f);"
+		"n.parentNode.removeChild(n);"
 		"s.removeAllRanges();"
 		"s.addRange(r);");
 }



More information about the Commits mailing list