Fixed bug #17156: htmlArea RTE: Disable Cell merge button in FF when less than two...
authorStanislas Rolland <typo3@sjbr.ca>
Thu, 20 Jan 2011 04:51:57 +0000 (04:51 +0000)
committerStanislas Rolland <typo3@sjbr.ca>
Thu, 20 Jan 2011 04:51:57 +0000 (04:51 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@10147 709f56b5-9817-0410-a4d7-c38de5d9e867

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

index edb355b..a66d718 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2011-01-19  Stanislas Rolland  <typo3@sjbr.ca>
+
+       * Fixed bug #17156: htmlArea RTE: Disable Cell merge button in FF when less than two cells are selected
+
 2011-01-19  Steffen Kamper  <steffen@typo3.org>
 
        * Fixed bug in tx_em_Connection_ExtDirectServer (from em svn)
index 5cdf533..36d31b0 100644 (file)
@@ -1,3 +1,7 @@
+2011-01-19  Stanislas Rolland  <typo3@sjbr.ca>
+
+       * Fixed bug #17156: htmlArea RTE: Disable Cell merge button in FF when less than two cells are selected
+
 2011-01-18  Stanislas Rolland  <typo3@sjbr.ca>
 
        * Fixed bug #16045: htmlArea RTE: Merging table cells using context menu doesn't work in Firefox
index f46564d..df0c23a 100644 (file)
@@ -681,8 +681,18 @@ HTMLArea.TableOperations = HTMLArea.Plugin.extend({
         * This function gets called when the toolbar is being updated
         */
        onUpdateToolbar: function (button, mode, selectionEmpty, ancestors) {
-               if (mode === 'wysiwyg' && this.editor.isEditable() && button.itemId === 'TO-toggle-borders') {
-                       button.setInactive(!HTMLArea.DOM.hasClass(this.editor._doc.body, 'htmlarea-showtableborders'));
+               if (mode === 'wysiwyg' && this.editor.isEditable()) {
+                       switch (button.itemId) {
+                               case 'TO-toggle-borders':
+                                       button.setInactive(!HTMLArea.DOM.hasClass(this.editor.document.body, 'htmlarea-showtableborders'));
+                                       break;
+                               case 'TO-cell-merge':
+                                       if (Ext.isGecko) {
+                                               var selection = this.editor._getSelection();
+                                               button.setDisabled(button.disabled || selection.rangeCount < 2);
+                                       }
+                                       break;
+                       }
                }
        },
        /*