* Fixed bug #7684: htmlArea RTE: Cursor positioning when creating new table
authorStanislas Rolland <typo3@sjbr.ca>
Fri, 29 Feb 2008 02:41:15 +0000 (02:41 +0000)
committerStanislas Rolland <typo3@sjbr.ca>
Fri, 29 Feb 2008 02:41:15 +0000 (02:41 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@3322 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/sysext/rtehtmlarea/ChangeLog
typo3/sysext/rtehtmlarea/htmlarea/plugins/TableOperations/table-operations.js

index 8147ea3..74d8750 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2008-02-28  Stanislas Rolland  <stanislas.rolland@fructifor.ca>
+
+       * Fixed bug #7684: htmlArea RTE: Cursor positioning when creating new table
+
 2008-02-28  Ingmar Schlecht  <ingmar@typo3.org>
 
        * Fixed bug #7502: Show Sitename on Login screen (Thanks to Steffen Kamper)
index 17b6877..9545fa5 100644 (file)
@@ -1,3 +1,7 @@
+2008-02-28  Stanislas Rolland  <stanislas.rolland@fructifor.ca>
+
+       * Fixed bug #7684: htmlArea RTE: Cursor positioning when creating new table
+
 2008-02-27  Stanislas Rolland  <stanislas.rolland@fructifor.ca>
 
        * Fixed bug #7697: Syntax error raised by Mozilla 1.7 when loading htmlArea RTE
index 7dc9d41..526dc3a 100644 (file)
@@ -249,6 +249,7 @@ TableOperations = HTMLArea.Plugin.extend({
                                tbody.appendChild(tr);
                                for (var j = params.f_cols; --j >= 0;) {
                                        var td = doc.createElement("td");
+                                       if (HTMLArea.is_gecko) td.innerHTML = "<br />";
                                        tr.appendChild(td);
                                }
                        }
@@ -337,15 +338,17 @@ TableOperations = HTMLArea.Plugin.extend({
                        }
                }
                if (dialog.buttonId === "InsertTable") {
-                       this.editor.insertNodeAtSelection(table);
                        if (HTMLArea.is_gecko) {
-                               this.editor.selectNodeContents(table.rows[0].cells[0], true);
+                               this.editor.insertNodeAtSelection(table);
+                       } else {
+                               table.id = "htmlarea_table_insert";
+                               this.editor.insertNodeAtSelection(table);
+                               table = this.editor._doc.getElementById(table.id);
+                               table.id = "";
                        }
+                       this.editor.selectNodeContents(table.rows[0].cells[0], true);
                        if (this.buttonsConfiguration.toggleborders && this.buttonsConfiguration.toggleborders.setOnTableCreation) {
                                this.toggleBorders(true);
-                       } else if (HTMLArea.is_gecko && !HTMLArea.is_safari && !HTMLArea.is_opera) {
-                                       // otherwise the cells are 2 pixels high..
-                               this.editor.setMode("wysiwyg");
                        }
                }
                dialog.close();
@@ -975,8 +978,6 @@ TableOperations = HTMLArea.Plugin.extend({
                } else if (!forceBorders) {
                        HTMLArea._removeClass(body,'htmlarea-showtableborders');
                }
-                       // The only way to get Firefox to show these borders...
-               if (HTMLArea.is_gecko && !HTMLArea.is_safari && !HTMLArea.is_opera) this.editor.setMode("wysiwyg");
        },
        
        /*