[BUGFIX] Typing after abbr or acronym tag is difficult 84/22684/2
authorStanislas Rolland <typo3@sjbr.ca>
Tue, 30 Jul 2013 03:16:15 +0000 (23:16 -0400)
committerStanislas Rolland <typo3@sjbr.ca>
Mon, 12 Aug 2013 19:21:22 +0000 (21:21 +0200)
Solution: After inserting the abbreviation, position the cursor
after and outside the inserted tag.

Resolves: #47806
Releases: 6.0, 6.1, 6.2
Change-Id: I4e8c47cf031fe3df2772ed47cb42122b8db9a646
Reviewed-on: https://review.typo3.org/22684
Reviewed-by: Stefan Neufeind
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
Reviewed-by: Stanislas Rolland
Tested-by: Stanislas Rolland
typo3/sysext/rtehtmlarea/htmlarea/plugins/Acronym/acronym.js

index 87320bb..15296c1 100644 (file)
@@ -512,6 +512,13 @@ HTMLArea.Acronym = Ext.extend(HTMLArea.Plugin, {
                                this.getPluginInstance('Language').setLanguageAttributes(abbr, language);
                        }
                        this.editor.getSelection().insertNode(abbr);
+                       // Position the cursor just after the inserted abbreviation
+                       abbr = this.editor.getSelection().getParentElement();
+                       if (abbr.nextSibling) {
+                               this.editor.getSelection().selectNodeContents(abbr.nextSibling, true);
+                       } else {
+                               this.editor.getSelection().selectNodeContents(abbr.parentNode, false);
+                       }
                } else {
                        var abbr = this.params.abbr;
                        abbr.title = tab.find('itemId', 'useTerm')[0].getValue();