[BUGFIX] RTE: Link class not always set in Firefox
authorStanislas Rolland <typo3@sjbr.ca>
Mon, 15 Oct 2012 22:52:51 +0000 (18:52 -0400)
committerStanislas Rolland <typo3@sjbr.ca>
Wed, 31 Oct 2012 18:45:27 +0000 (19:45 +0100)
Problem: The range of the selection may be modified by the execCommand in
Firefox, at least since version 14.
Solution: Re-establish the range.

Change-Id: Ied6ff3570be99bac993163cc94b801a3872aa6a9
Resolves: #39662
Releases: 4.5, 4.6, 4.7, 6.0
Reviewed-on: http://review.typo3.org/15666
Reviewed-by: Stanislas Rolland
Tested-by: Stanislas Rolland
typo3/sysext/rtehtmlarea/htmlarea/plugins/TYPO3Link/typo3link.js

index eca3115..a81fa9f 100644 (file)
@@ -245,8 +245,10 @@ HTMLArea.TYPO3Link = Ext.extend(HTMLArea.Plugin, {
                        } else {
                                this.editor.getSelection().execCommand('CreateLink', false, theLink);
                        }
-                               // Get the created link or parent
+                       // Get the created link or parent
                        node = this.editor.getSelection().getParentElement();
+                       // Re-establish the range of the selection
+                       range = this.editor.getSelection().createRange();
                        if (node) {
                                        // Export trailing br that IE may include in the link
                                if (Ext.isIE) {