From 239b5efe9b4f9cd2c5da630a05de428008f4c3bd Mon Sep 17 00:00:00 2001 From: Stanislas Rolland Date: Thu, 20 Jan 2011 04:51:57 +0000 Subject: [PATCH] Fixed bug #17156: htmlArea RTE: Disable Cell merge button in FF when less than two cells are selected git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@10147 709f56b5-9817-0410-a4d7-c38de5d9e867 --- ChangeLog | 4 ++++ typo3/sysext/rtehtmlarea/ChangeLog | 4 ++++ .../plugins/TableOperations/table-operations.js | 14 ++++++++++++-- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index edb355b1c97d..a66d71824fbd 100755 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2011-01-19 Stanislas Rolland + + * Fixed bug #17156: htmlArea RTE: Disable Cell merge button in FF when less than two cells are selected + 2011-01-19 Steffen Kamper * Fixed bug in tx_em_Connection_ExtDirectServer (from em svn) diff --git a/typo3/sysext/rtehtmlarea/ChangeLog b/typo3/sysext/rtehtmlarea/ChangeLog index 5cdf53360261..36d31b0f3b7e 100644 --- a/typo3/sysext/rtehtmlarea/ChangeLog +++ b/typo3/sysext/rtehtmlarea/ChangeLog @@ -1,3 +1,7 @@ +2011-01-19 Stanislas Rolland + + * Fixed bug #17156: htmlArea RTE: Disable Cell merge button in FF when less than two cells are selected + 2011-01-18 Stanislas Rolland * Fixed bug #16045: htmlArea RTE: Merging table cells using context menu doesn't work in Firefox diff --git a/typo3/sysext/rtehtmlarea/htmlarea/plugins/TableOperations/table-operations.js b/typo3/sysext/rtehtmlarea/htmlarea/plugins/TableOperations/table-operations.js index f46564d6fe93..df0c23ad3ed6 100644 --- a/typo3/sysext/rtehtmlarea/htmlarea/plugins/TableOperations/table-operations.js +++ b/typo3/sysext/rtehtmlarea/htmlarea/plugins/TableOperations/table-operations.js @@ -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; + } } }, /* -- 2.20.1