changeset 5818:8b17f7e86ba4

fix selection FCKeditor plugin for chrome. Thanks for the patch go to "SixMen"!
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sat, 14 Jan 2012 19:14:28 +0100
parents d8ac2a401f8f
children e55c5df76cee
files MoinMoin/web/static/htdocs/applets/moinFCKplugins/selection/fckplugin.js
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/web/static/htdocs/applets/moinFCKplugins/selection/fckplugin.js	Mon Jan 09 21:26:50 2012 +0100
+++ b/MoinMoin/web/static/htdocs/applets/moinFCKplugins/selection/fckplugin.js	Sat Jan 14 19:14:28 2012 +0100
@@ -321,6 +321,8 @@
   FCKSelection.GetStartNode = function()
     {
       var oSelection = FCKSelection.GetSelection();
+      if (oSelection.rangeCount == 0) // this fixes Chrome Browser exception on FCKeditor init
+        return null;
       // startContainer returns the parent of the first node in the selection
       var oContainer = oSelection.getRangeAt(0).startContainer;
       // The offset within the startContainer where the range starts
@@ -343,6 +345,8 @@
   FCKSelection.GetEndNode = function()
   {
     var oSelection = FCKSelection.GetSelection();
+    if (oSelection.rangeCount == 0) // this fixes Chrome Browser exception on FCKeditor init
+      return null;
     var oContainer = oSelection.getRangeAt(0).endContainer;
     var iOffset = oSelection.getRangeAt(0).startEndset;