r1587 - branches/bxe_2_0/js

[email protected] Fri, 27 Oct 2006 11:48:46 +0200 (CEST)
Newsgroups gmane.editors.bitflux.cvs
Message-ID <[email protected]>
Author: chregu
Date: Fri Oct 27 11:48:45 2006
New Revision: 1587

Modified:
   branches/bxe_2_0/js/widget.js
Log:
improved, but not perfect

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 27 11:48:45 2006
@@ -87,12 +87,15 @@
 
 Widget.prototype.hide = function () {
 	var sel = window.getSelection();
-			
-	if ( sel.anchorNode && sel.anchorNode.compareDocumentPosition(this.node) & Node.DOCUMENT_POSITION_CONTAINS) {
+		
+	if (this.cssr) {
+		sel.selectEditableRange(this.cssr);
+	} else if ( sel.anchorNode && sel.anchorNode.compareDocumentPosition(this.node) & Node.DOCUMENT_POSITION_CONTAINS) {
 			sel.collapse(document.documentElement.firstChild, 0);
 	}
 			
 	this.node.style.display = 'none';
+	
 }
 
 
@@ -1133,6 +1136,8 @@
 Widget_ModalBox.prototype.submitAndClose = function (e) {
 	var Widget = e.currentTarget.Widget;
 	e.preventDefault();
+	
+	
 	Widget.hide();
 	bxe_registerKeyHandlers();
 	var elem = e.currentTarget.elements;
-- 
Bx-editor-cvs mailing list
[email protected]
http://lists.bitflux.ch/cgi-bin/listinfo/bx-editor-cvs