[BUGFIX] Reintroduce context menu on page title in the page tree 09/51609/5
authorTymoteusz Motylewski <t.motylewski@gmail.com>
Thu, 9 Feb 2017 14:14:19 +0000 (15:14 +0100)
committerAndreas Fernandez <typo3@scripting-base.de>
Fri, 10 Feb 2017 10:47:08 +0000 (11:47 +0100)
Since context menu refactoring https://review.typo3.org/#/c/50124/
the context was not showing when right clicking on the page title in
the page tree.

Resolves: #79710
Releases: master
Change-Id: Idcdb9a8afebe050bb0b409b7d475285d1a1d4419
Reviewed-on: https://review.typo3.org/51609
Reviewed-by: Josef Glatz <josef.glatz@typo3.org>
Tested-by: Josef Glatz <josef.glatz@typo3.org>
Reviewed-by: Mona Muzaffar <mona.muzaffar@gmx.de>
Tested-by: Mona Muzaffar <mona.muzaffar@gmx.de>
Tested-by: TYPO3com <no-reply@typo3.com>
Tested-by: volker kemeter <volker@kemeter.de>
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Tested-by: Andreas Fernandez <typo3@scripting-base.de>
typo3/sysext/backend/Resources/Public/JavaScript/extjs/components/pagetree/javascript/tree.js

index c9d2f44..e9bca25 100644 (file)
@@ -235,7 +235,13 @@ TYPO3.Components.PageTree.Tree = Ext.extend(Ext.tree.TreePanel, {
                        this.dragConfig = {ddGroup: this.ddGroup};
                        this.enableDragAndDrop();
                }
-
+               this.on('contextmenu', function(node, event) {
+                       require(['TYPO3/CMS/Backend/ContextMenu'], function(ContextMenu) {
+                               var parameters = 'context=tree&table=pages&uid=' + node.attributes.nodeData.id;
+                               ContextMenu.record = {table: 'pages', uid: node.attributes.nodeData.id};
+                               ContextMenu.fetch(parameters);
+                       });
+               });
                TYPO3.Components.PageTree.Tree.superclass.initComponent.apply(this, arguments);
        },