r1569 - branches/bxe_2_0/mozile

[email protected] Tue, 24 Oct 2006 14:25:33 +0200 (CEST)
Newsgroups gmane.editors.bitflux.cvs
Message-ID <[email protected]>
Author: chregu
Date: Tue Oct 24 14:25:33 2006
New Revision: 1569

Modified:
   branches/bxe_2_0/mozile/mozilekb.js
Log:
check if _par exists


Modified: branches/bxe_2_0/mozile/mozilekb.js
==============================================================================
--- branches/bxe_2_0/mozile/mozilekb.js	(original)
+++ branches/bxe_2_0/mozile/mozilekb.js	Tue Oct 24 14:25:33 2006
@@ -637,10 +637,15 @@
 				var xmlnode = bxe_getXMLNodeByHTMLNode(sel.anchorNode);
 				//xmlnode.parentNode.appendChild(xmlnode.ownerDocument.createTextNode(" "));
 				var _par = xmlnode.parentNode;
-				
-				_par.removeChild(xmlnode);
-				_par.XMLNode.makeDefaultNodes();
-				bxe_Transform();
+				if (_par) {
+					_par.removeChild(xmlnode);
+					_par.XMLNode.makeDefaultNodes();
+					bxe_Transform();
+				} else {
+					bxe_deleteWholeSelection(sel,backspace);
+					sel = window.getSelection();
+					sel.deleteSelection(false);
+				}
 			} else {
 				bxe_deleteWholeSelection(sel,backspace);
 				sel = window.getSelection();
-- 
Bx-editor-cvs mailing list
[email protected]
http://lists.bitflux.ch/cgi-bin/listinfo/bx-editor-cvs