[BUGFIX] RTE: Status bar update is happening too late 56/35556/4
authorStanislas Rolland <typo3@sjbr.ca>
Thu, 18 Dec 2014 02:23:55 +0000 (21:23 -0500)
committerStanislas Rolland <typo3@sjbr.ca>
Thu, 18 Dec 2014 02:32:09 +0000 (03:32 +0100)
Force status bar update on initialization and before each toolbar update.

Releases: master
Resolves: #63970
Change-Id: I39833e1256b9b5df2ad0400238278d59921f00c0
Reviewed-on: http://review.typo3.org/35556
Reviewed-by: Stanislas Rolland <typo3@sjbr.ca>
Tested-by: Stanislas Rolland <typo3@sjbr.ca>
typo3/sysext/rtehtmlarea/Resources/Public/JavaScript/HTMLArea/Editor/Editor.js
typo3/sysext/rtehtmlarea/Resources/Public/JavaScript/HTMLArea/Editor/StatusBar.js
typo3/sysext/rtehtmlarea/Resources/Public/JavaScript/HTMLArea/Editor/Toolbar.js

index a3cb9f8..8074490 100644 (file)
@@ -259,6 +259,7 @@ define('TYPO3/CMS/Rtehtmlarea/HTMLArea/Editor/Editor',
                this.generatePlugins();
                // Make the editor visible
                this.show();
+               this.toolbar.update();
                // Make the wizards visible again
                if (this.wizards && this.wizards.nodeType === Dom.ELEMENT_NODE) {
                        this.wizards.style.display = '';
index 0526931..63eac85 100644 (file)
@@ -58,9 +58,6 @@ define('TYPO3/CMS/Rtehtmlarea/HTMLArea/Editor/StatusBar',
                 */
                initEventListeners: function () {
                        var self = this;
-                       // Monitor toolbar updates in order to refresh the contents of the statusbar
-                       // The toolbar must have been rendered
-                       Event.on(this.framework.toolbar, 'HTMLAreaEventToolbarUpdate', function (event, mode, selectionEmpty, ancestors, endPointsInSameBlock) { Event.stopEvent(event); self.onUpdateToolbar(mode, selectionEmpty, ancestors, endPointsInSameBlock); return false; });
                        // Monitor editor changing mode
                        Event.on(this.getEditor(), 'HTMLAreaEventModeChange', function (event, mode) { Event.stopEvent(event); self.onModeChange(mode); return false; });
                        // Monitor word count change
@@ -142,8 +139,6 @@ define('TYPO3/CMS/Rtehtmlarea/HTMLArea/Editor/StatusBar',
                        while (node = this.statusBarTree.firstChild) {
                                if (/^(a)$/i.test(node.nodeName)) {
                                        Event.off(node);
-                                       node.removeAttribute('ext:qtitle');
-                                       node.removeAttribute('ext:qtip');
                                }
                                Dom.removeFromParent(node);
                        }
@@ -161,7 +156,7 @@ define('TYPO3/CMS/Rtehtmlarea/HTMLArea/Editor/StatusBar',
                 * @return void
                 */
                onUpdateToolbar: function (mode, selectionEmpty, ancestors, endPointsInSameBlock) {
-                       if (mode === 'wysiwyg' && !this.noUpdate) {
+                       if (mode === 'wysiwyg' && !this.noUpdate && this.getEditor().config.showStatusBar) {
                                var self = this;
                                var text,
                                        language,
index 5f843da..3a56a1b 100644 (file)
@@ -264,6 +264,7 @@ define('TYPO3/CMS/Rtehtmlarea/HTMLArea/Editor/Toolbar',
                                ancestors = selection.getAllAncestors();
                                endPointsInSameBlock = selection.endPointsInSameBlock();
                        }
+                       this.framework.getStatusBar().onUpdateToolbar(mode, selectionEmpty, ancestors, endPointsInSameBlock);
                        /**
                         * @event HTMLAreaEventToolbarUpdate
                         * Fires when the toolbar is updated