[BUGFIX] RTE doesn't allow to create links around images in IE8
authorStanislas Rolland <typo3@sjbr.ca>
Thu, 10 Nov 2011 15:17:42 +0000 (10:17 -0500)
committerErnesto Baschny <ernst@cron-it.de>
Fri, 18 Nov 2011 11:25:08 +0000 (12:25 +0100)
Solution: Workaround IE bookmarking not being possible on control range

Change-Id: I101ce32a9319a020fe72df237f10b9146313e18b
Resolves: #30631
Releases: 4.5, 4.6, 4.7
Reviewed-on: http://review.typo3.org/6616
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
Reviewed-by: Helmut Hummel
Tested-by: Helmut Hummel
Reviewed-by: Ernesto Baschny
Tested-by: Ernesto Baschny
typo3/sysext/rtehtmlarea/htmlarea/htmlarea-ie.js

index 7d6e898..443975c 100644 (file)
@@ -189,7 +189,12 @@ HTMLArea.Editor.prototype._selectionEmpty = function(selection) {
  * Get a bookmark
  */
 HTMLArea.Editor.prototype.getBookmark = function (range) {
-       return range.getBookmark();
+               // Bookmarking will not work on control ranges
+       try {
+               return range.getBookmark();
+       } catch (e) {
+               return null;
+       }
 };
 
 /*
@@ -197,7 +202,9 @@ HTMLArea.Editor.prototype.getBookmark = function (range) {
  */
 HTMLArea.Editor.prototype.moveToBookmark = function (bookmark) {
        var range = this._createRange();
-       range.moveToBookmark(bookmark);
+       if (bookmark) {
+               range.moveToBookmark(bookmark);
+       }
        return range;
 };