[BUGFIX] Fix update of existing links 16/52316/2
authorFrank Naegler <frank.naegler@typo3.org>
Sun, 2 Apr 2017 15:01:44 +0000 (17:01 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Sun, 2 Apr 2017 16:48:27 +0000 (18:48 +0200)
This patch fix an issue while update existing links in case no selection exists.

Resolves: #80637
Releases: master
Change-Id: I89bc0603e9f0bba8f9ae1a1ef3563fc1f4432004
Reviewed-on: https://review.typo3.org/52316
Tested-by: TYPO3com <no-reply@typo3.com>
Tested-by: Riccardo De Contardi <erredeco@gmail.com>
Reviewed-by: Mona Muzaffar <mona.muzaffar@gmx.de>
Reviewed-by: Riccardo De Contardi <erredeco@gmail.com>
Reviewed-by: Daniel Goerz <ervaude@gmail.com>
Tested-by: Daniel Goerz <ervaude@gmail.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/RteLinkBrowser.js

index 925e967..e59c571 100644 (file)
@@ -88,6 +88,9 @@ define(['jquery', 'TYPO3/CMS/Recordlist/LinkBrowser', 'TYPO3/CMS/Backend/Modal']
                linkElement.setAttribute('href', link + params);
 
                var selection = RteLinkBrowser.CKEditor.getSelection();
+               if (selection && selection.getSelectedText() === '') {
+                       selection.selectElement(selection.getStartElement());
+               }
                if (selection && selection.getSelectedText()) {
                        linkElement.setText(selection.getSelectedText());
                } else {