r1581 - branches/bxe_2_0/js

[email protected] Thu, 26 Oct 2006 13:42:06 +0200 (CEST)
Newsgroups gmane.editors.bitflux.cvs
Message-ID <[email protected]>
Author: chregu
Date: Thu Oct 26 13:42:05 2006
New Revision: 1581

Modified:
   branches/bxe_2_0/js/bxeFunctions.js
Log:
fix clean in context menu

Modified: branches/bxe_2_0/js/bxeFunctions.js
==============================================================================
--- branches/bxe_2_0/js/bxeFunctions.js	(original)
+++ branches/bxe_2_0/js/bxeFunctions.js	Thu Oct 26 13:42:05 2006
@@ -758,6 +758,20 @@
 			bxe_history_snapshot();
 			
 			var par = delNode.parentNode;
+			try {
+				var _prev = delNode._htmlnode.previousSibling;
+				var sel = window.getSelection();
+				var _pos = 0;
+				
+				if (_prev) {
+					_pos = _prev.nodeValue.length;
+					sel.collapse(_prev,_pos);
+				} else {
+					sel.collapse(par._htmlnode.firstChild,0);
+				}
+			} catch(e) {
+			}
+			
 			delNode._node.removeElementOnly();
 			bxe_Transform(false,false,par);
 		}, bxe_i18n.getText("Removes the Element, but not its children"));
-- 
Bx-editor-cvs mailing list
[email protected]
http://lists.bitflux.ch/cgi-bin/listinfo/bx-editor-cvs