* Fixed bug #7770: htmlArea RTE: shift+tab in table body does not move back into...
authorStanislas Rolland <typo3@sjbr.ca>
Wed, 5 Mar 2008 21:42:17 +0000 (21:42 +0000)
committerStanislas Rolland <typo3@sjbr.ca>
Wed, 5 Mar 2008 21:42:17 +0000 (21:42 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@3387 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/sysext/rtehtmlarea/ChangeLog
typo3/sysext/rtehtmlarea/htmlarea/plugins/BlockElements/block-elements.js

index cf037b7..bd2e0e4 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
 2008-03-05  Stanislas Rolland  <typo3@sjbr.ca>
 
        * Fixed bug #7757: htmlArea RTE: Alternating table rows/columns should start at 1
+       * Fixed bug #7770: htmlArea RTE: shift+tab in table body does not move back into thead
 
 2008-03-04  Stanislas Rolland  <typo3@sjbr.ca>
 
index 3434984..e483d7d 100644 (file)
@@ -1,6 +1,7 @@
 2008-03-05  Stanislas Rolland  <typo3@sjbr.ca>
 
        * Fixed bug #7757: htmlArea RTE: Alternating table rows/columns should start at 1
+       * Fixed bug #7770: htmlArea RTE: shift+tab in table body does not move back into thead
 
 2008-03-04  Stanislas Rolland  <typo3@sjbr.ca>
 
index 54f6d29..8af497d 100644 (file)
@@ -334,7 +334,22 @@ BlockElements = HTMLArea.Plugin.extend({
                                } else if (tableCell) {
                                        var previousCell = tableCell.previousSibling ? tableCell.previousSibling : (tableCell.parentNode.previousSibling ? tableCell.parentNode.previousSibling.lastChild : null);
                                        if (!previousCell) {
-                                               previousCell = tableCell.parentNode.parentNode.lastChild.lastChild;
+                                               var table = tableCell.parentNode.parentNode.parentNode;
+                                               var tablePart = tableCell.parentNode.parentNode.nodeName.toLowerCase();
+                                               switch (tablePart) {
+                                                       case "tbody":
+                                                               if (table.tHead) {
+                                                                       previousCell = table.tHead.rows[table.tHead.rows.length-1].cells[table.tHead.rows[table.tHead.rows.length-1].cells.length-1];
+                                                                       break;
+                                                               }
+                                                       case "thead":
+                                                               if (table.tFoot) {
+                                                                       previousCell = table.tFoot.rows[table.tFoot.rows.length-1].cells[table.tFoot.rows[table.tFoot.rows.length-1].cells.length-1];
+                                                                       break;
+                                                               }
+                                                       case "tfoot":
+                                                               previousCell = table.tBodies[table.tBodies.length-1].rows[table.tBodies[table.tBodies.length-1].rows.length-1].cells[table.tBodies[table.tBodies.length-1].rows[table.tBodies[table.tBodies.length-1].rows.length-1].cells.length-1];
+                                               }
                                        }
                                        if (previousCell) {
                                                this.editor.selectNodeContents(previousCell, true);