Fixed bug #12782: htmlArea RTE: Editing a link title or target with Firefox 3 sometim...
authorStanislas Rolland <typo3@sjbr.ca>
Sat, 12 Dec 2009 02:50:08 +0000 (02:50 +0000)
committerStanislas Rolland <typo3@sjbr.ca>
Sat, 12 Dec 2009 02:50:08 +0000 (02:50 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@6657 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/sysext/rtehtmlarea/ChangeLog
typo3/sysext/rtehtmlarea/htmlarea/plugins/TYPO3Link/typo3link.js

index 253f30f..9173482 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2009-12-11  Stanislas Rolland  <typo3@sjbr.ca>
+
+       * Fixed bug #12782: htmlArea RTE: Editing a link title or target with Firefox 3 sometimes simply unlinks the link
+
 2009-12-11  Xavier Perseguers  <typo3@perseguers.ch>
 
        * Fixed bug #12897: Cannot parse SQL hints
index 717df05..aea2012 100644 (file)
@@ -1,3 +1,7 @@
+2009-12-11  Stanislas Rolland  <typo3@sjbr.ca>
+
+       * Fixed bug #12782: htmlArea RTE: Editing a link title or target with Firefox 3 sometimes simply unlinks the link
+
 2009-12-10  Stanislas Rolland  <typo3@sjbr.ca>
 
        * Fixed bug #13004: htmlArea RTE: buttons.table.disableEnterParagraphs not honoured in Opera
index 646c7f0..241f767 100644 (file)
@@ -175,7 +175,12 @@ TYPO3Link = HTMLArea.Plugin.extend({
                if (HTMLArea.is_gecko && node != null && /^a$/i.test(node.nodeName)) {
                                // If the class attribute is not removed, UnLink folowed by CreateLink will create a span element inside the new link
                        node.removeAttribute("class");
+                               // Moreover, the selection is sometimes lost after the unlink operation
+                       selection = this.editor._getSelection();
+                       range = this.editor._createRange(selection);
+                       var bookmark = this.editor.getBookmark(range);
                        this.editor._doc.execCommand("UnLink", false, null);
+                       this.editor.selectRange(this.editor.moveToBookmark(bookmark));
                }
                if (HTMLArea.is_gecko && !HTMLArea.is_safari && !HTMLArea.is_opera) {
                        this.editor._doc.execCommand("CreateLink", false, encodeURI(theLink));