r1586 - branches/bxe_2_0/js
[email protected] Fri, 27 Oct 2006 11:26:17 +0200 (CEST)
| Newsgroups | gmane.editors.bitflux.cvs |
|---|---|
| Message-ID | <[email protected]> |
Author: chregu
Date: Fri Oct 27 11:26:15 2006
New Revision: 1586
Modified:
branches/bxe_2_0/js/bxeFunctions.js
branches/bxe_2_0/js/widget.js
Log:
fix a potential error
Modified: branches/bxe_2_0/js/bxeFunctions.js
==============================================================================
--- branches/bxe_2_0/js/bxeFunctions.js (original)
+++ branches/bxe_2_0/js/bxeFunctions.js Fri Oct 27 11:26:15 2006
@@ -2421,11 +2421,22 @@
}
function bxe_getXMLNodeByHTMLNode(node) {
-
return node.XMLNode._node;
+}
+
+function bxe_getXMLNodeByHTMLNodeRecursive(node) {
+
+ while (node) {
+ if (node.XMLNode && node.XMLNode._node) {
+ return node.XMLNode._node;
+ }
+ node = node.parentNode;
+ }
+ return null;
}
+
function bxe_getBxeId(node) {
return node.getAttribute("__bxe_id");
}
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:26:15 2006
@@ -88,7 +88,7 @@
Widget.prototype.hide = function () {
var sel = window.getSelection();
- if ( sel.anchorNode.compareDocumentPosition(this.node) & Node.DOCUMENT_POSITION_CONTAINS) {
+ if ( sel.anchorNode && sel.anchorNode.compareDocumentPosition(this.node) & Node.DOCUMENT_POSITION_CONTAINS) {
sel.collapse(document.documentElement.firstChild, 0);
}
--
Bx-editor-cvs mailing list
[email protected]
http://lists.bitflux.ch/cgi-bin/listinfo/bx-editor-cvs