Fixed bug #15477: htmlArea RTE: Unlink may unlink the wrong link in IE
authorStanislas Rolland <typo3@sjbr.ca>
Thu, 26 Aug 2010 13:58:09 +0000 (13:58 +0000)
committerStanislas Rolland <typo3@sjbr.ca>
Thu, 26 Aug 2010 13:58:09 +0000 (13:58 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/branches/TYPO3_4-4@8694 709f56b5-9817-0410-a4d7-c38de5d9e867

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

index 6777d41..773bf0b 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2010-08-26  Stanislas Rolland  <typo3@sjbr.ca>
+
+       * Fixed bug #15477: htmlArea RTE: Unlink may unlink the wrong link in IE
+
 2010-08-25  Stanislas Rolland  <typo3@sjbr.ca>
 
        * Fixed bug #15547: htmlArea RTE may load extJS debug script in FE which makes page loading slow
index 029e319..b969052 100644 (file)
@@ -1,3 +1,7 @@
+2010-08-26  Stanislas Rolland  <typo3@sjbr.ca>
+
+       * Fixed bug #15477: htmlArea RTE: Unlink may unlink the wrong link in IE
+
 2010-08-25  Stanislas Rolland  <typo3@sjbr.ca>
 
        * Fixed bug #15547: htmlArea RTE may load extJS debug script in FE which makes page loading slow
index b129bdf..8968e8a 100644 (file)
@@ -131,7 +131,7 @@ HTMLArea.TYPO3Link = HTMLArea.Plugin.extend({
                        });
                } else {
                        if (buttonId === "UnLink") {
-                               this.unLink();
+                               this.unLink(true);
                                return false;
                        }
                        var additionalParameter;
@@ -248,12 +248,19 @@ HTMLArea.TYPO3Link = HTMLArea.Plugin.extend({
        },
        
        /*
-       * Unlink the selection.
-       * This function is called from the TYPO3 link popup and from the context menu.
-       */
-       unLink : function() {
+        * Unlink the selection.
+        * This function is called from the TYPO3 link popup and from unlink button pressed in toolbar or context menu.
+        *
+        * @param       string  buttonPressd: true if the unlink button was pressed
+        *
+        * @return void
+        */
+       unLink: function (buttonPressed) {
                this.editor.focus();
-               this.restoreSelection();
+                       // If no dialogue window was opened, the selection should not be restored
+               if (!buttonPressed) {
+                       this.restoreSelection();
+               }
                var node = this.editor.getParentElement();
                var el = HTMLArea.getElementObject(node, "a");
                if (el != null && /^a$/i.test(el.nodeName)) node = el;