Fixed bug #11362: htmlArea RTE: Cursor may not be put in list elements newly created...
authorStanislas Rolland <typo3@sjbr.ca>
Mon, 16 Nov 2009 00:49:59 +0000 (00:49 +0000)
committerStanislas Rolland <typo3@sjbr.ca>
Mon, 16 Nov 2009 00:49:59 +0000 (00:49 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@6425 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/sysext/rtehtmlarea/ChangeLog
typo3/sysext/rtehtmlarea/htmlarea/htmlarea-gecko.js

index e779e34..b10d1a5 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -15,6 +15,7 @@
 
        * Fixed bug #12597: htmlArea RTE: cursor position is not restored by undo/redo operations in Opera
        * Fixed bug #12421: htmlArea RTE: Paste is erratic in Opera 10 when server-based cleaning is enabled
+       * Fixed bug #11362: htmlArea RTE: Cursor may not be put in list elements newly created in front of links
 
 2009-11-14  Francois Suter  <francois@typo3.org>
 
index 1284a32..b05c914 100644 (file)
@@ -2,6 +2,7 @@
 
        * Fixed bug #12597: htmlArea RTE: cursor position is not restored by undo/redo operations in Opera
        * Fixed bug #12421: htmlArea RTE: Paste is erratic in Opera 10 when server-based cleaning is enabled
+       * Fixed bug #11362: htmlArea RTE: Cursor may not be put in list elements newly created in front of links
 
 2009-11-12  Stanislas Rolland  <typo3@sjbr.ca>
 
index c84c598..c3028db 100644 (file)
@@ -701,7 +701,16 @@ HTMLArea.prototype._checkInsertP = function() {
                                // Remove any anchor created empty
                        if (p.previousSibling) {
                                var a = p.previousSibling.lastChild;
-                               if (a && /^a$/i.test(a.nodeName) && !/\S/.test(a.innerHTML)) HTMLArea.removeFromParent(a);
+                               if (a && /^a$/i.test(a.nodeName) && !/\S/.test(a.innerHTML)) {
+                                       if (HTMLArea.is_opera) {
+                                               this.removeMarkup(a);
+                                       } else {
+                                               HTMLArea.removeFromParent(a);
+                                       }
+                               }
+                               if (!/\S/.test(p.previousSibling.textContent) && !HTMLArea.is_opera) {
+                                       p.previousSibling.innerHTML = "<br />";
+                               }
                        }
                        if (/^br$/i.test(p.nodeName)) {
                                p = p.parentNode.insertBefore(this._doc.createTextNode("\x20"), p);