r1699 - branches/bxe_2_0/js

[email protected] Fri, 3 Aug 2007 17:51:51 +0200 (CEST)
Newsgroups gmane.editors.bitflux.cvs
Message-ID <[email protected]>
Author: chregu
Date: Fri Aug  3 17:51:51 2007
New Revision: 1699

Log:
fix BXEB-11
Caption laesst sich nach Caption appenden


Modified:
   branches/bxe_2_0/js/bxeFunctions.js
   branches/bxe_2_0/js/bxeXMLNode.js

Modified: branches/bxe_2_0/js/bxeFunctions.js
==============================================================================
--- branches/bxe_2_0/js/bxeFunctions.js	(original)
+++ branches/bxe_2_0/js/bxeFunctions.js	Fri Aug  3 17:51:51 2007
@@ -779,8 +779,11 @@
 			} catch(e) {
 			}
 			delNode.unlink();
-			
-			bxe_Transform(false,false,par);
+			if (par.parentNode) {
+				bxe_Transform(false,false,par.parentNode);
+			} else {
+				bxe_Transform(false,false,par);
+			}
 		},bxe_i18n.getText("Deletes the Element and all its children"));
 	}
 	if (node.parentNode.canHaveText) {

Modified: branches/bxe_2_0/js/bxeXMLNode.js
==============================================================================
--- branches/bxe_2_0/js/bxeXMLNode.js	(original)
+++ branches/bxe_2_0/js/bxeXMLNode.js	Fri Aug  3 17:51:51 2007
@@ -166,6 +166,25 @@
 	return this._node.hasChildNodes();
 
 }
+//"Real" means elements or textnodes without whitespace only textnodes
+XMLNode.prototype.hasRealChildNodes = function() {
+	if (! this._node.hasChildNodes()) {
+		return false;
+	}
+	
+	var _n = this._node.firstChild;
+	do {
+		if (_n.nodeType == 1) {
+			return true;
+		} else if (_n.nodeType == 3 && (/\S+/.test(_n.nodeValue))) {
+			return true;
+		}
+		_n = _n.nextSibling;
+	} while (_n);
+	return false;
+
+}
+
 
 XMLNode.prototype.__defineGetter__( 
 	"allowedChildren",
-- 
Bx-editor-cvs mailing list
[email protected]
http://lists.bitflux.ch/cgi-bin/listinfo/bx-editor-cvs