[BUGFIX] RTE: Broken context menu 16/35316/2
authorStanislas Rolland <typo3@sjbr.ca>
Thu, 11 Dec 2014 18:16:11 +0000 (13:16 -0500)
committerStanislas Rolland <typo3@sjbr.ca>
Thu, 11 Dec 2014 18:21:08 +0000 (19:21 +0100)
RTE is not using the ExtJS registry anymore.

Releases: master
Resolves: #63785
Change-Id: I9d701062834d20c858c1043743f55e813f16dc37
Reviewed-on: http://review.typo3.org/35316
Reviewed-by: Stanislas Rolland <typo3@sjbr.ca>
Tested-by: Stanislas Rolland <typo3@sjbr.ca>
typo3/sysext/rtehtmlarea/Resources/Public/JavaScript/Plugins/ContextMenu.js

index fad8d13..7d219ba 100644 (file)
@@ -41,7 +41,7 @@ define('TYPO3/CMS/Rtehtmlarea/Plugins/ContextMenu',
                        if (this.pageTSConfiguration.hideButtons) {
                                this.hideButtons = this.pageTSConfiguration.hideButtons;
                        }
-                       /*
+                       /**
                         * Registering plugin "About" information
                         */
                        var pluginInformation = {
@@ -88,6 +88,7 @@ define('TYPO3/CMS/Rtehtmlarea/Plugins/ContextMenu',
                        var iframe = this.editor.iframe.getEl().dom;
                        Event.one(iframe.contentWindow ? iframe.contentWindow : iframe.contentDocument, 'unload', function (event) { self.onBeforeDestroy(event); return  true; });
                },
+
                /**
                 * Create the menu items config
                 */
@@ -117,7 +118,8 @@ define('TYPO3/CMS/Rtehtmlarea/Plugins/ContextMenu',
                                                if ((!this.showButtons || this.showButtons.indexOf(convertedItemId) !== -1)
                                                        && (!this.hideButtons || this.hideButtons.indexOf(convertedItemId) === -1)) {
                                                        var button = this.getButton(itemId);
-                                                       if (button && button.getXType() === 'htmlareabutton' && !button.hideInContextMenu) {
+                                                       // xtype is set through applied button configuration
+                                                       if (button && button.xtype === 'htmlareabutton' && !button.hideInContextMenu) {
                                                                var itemId = button.getItemId();
                                                                itemsConfig.push({
                                                                        itemId: itemId,
@@ -194,7 +196,8 @@ define('TYPO3/CMS/Rtehtmlarea/Plugins/ContextMenu',
                                // Show the context menu
                        this.menu.showAt([Ext.fly(target).getX() + iframeEl.getX(), Ext.fly(target).getY() + iframeEl.getY()]);
                },
-               /*
+
+               /**
                 * Show items depending on context
                 */
                showContextItems: function (target) {
@@ -215,7 +218,7 @@ define('TYPO3/CMS/Rtehtmlarea/Plugins/ContextMenu',
                                                menuItem.setVisible(!button.disabled);
                                                lastIsButton = lastIsButton || !button.disabled;
                                        } else {
-                                                       // Special target delete item
+                                               // Special target delete item
                                                this.deleteTarget = target;
                                                if (/^(html|body)$/i.test(target.nodeName)) {
                                                        this.deleteTarget = null;