r1770 - branches/bxe_2_0/js

[email protected] Fri, 26 Oct 2007 15:57:51 +0200 (CEST)
Newsgroups gmane.editors.bitflux.cvs
Message-ID <[email protected]>
Author: chregu
Date: Fri Oct 26 15:57:51 2007
New Revision: 1770

Log:
fix BXEB-2
Cursor verschwindet nach Validation Error


Modified:
   branches/bxe_2_0/js/widget.js

Modified: branches/bxe_2_0/js/widget.js
==============================================================================
--- branches/bxe_2_0/js/widget.js	(original)
+++ branches/bxe_2_0/js/widget.js	Fri Oct 26 15:57:51 2007
@@ -1268,8 +1268,12 @@
 		}
 		var sel = window.getSelection();
 		try {
-			sel.collapse(Widget.selAnchorNode,Widget.selAnchorOffset);
-			sel.extend(Widget.selFocusNode,Widget.selFocusOffset);
+			if (sel.anchorNode.nodeName == 'HEAD') {
+				sel.collapse(document.body.firstChild,0);	
+			} else {
+				sel.collapse(Widget.selAnchorNode,Widget.selAnchorOffset);
+				sel.extend(Widget.selFocusNode,Widget.selFocusOffset);
+			}
 		} catch (f) {
 			sel.selectEditableRange(Widget.cssr);
 		}
-- 
Bx-editor-cvs mailing list
[email protected]
http://lists.bitflux.ch/cgi-bin/listinfo/bx-editor-cvs