[TASK] Massive performance improvement for page tree 82/39382/2
authorFrank Nägler <typo3@naegler.net>
Sat, 9 May 2015 14:03:51 +0000 (16:03 +0200)
committerBenjamin Mack <benni@typo3.org>
Sat, 9 May 2015 15:05:51 +0000 (17:05 +0200)
This patch improves the performance by removing delays.

A single click in the tree loads the page now significantly faster, however,
the page is now loaded also with a doubleclick.

With a tree implementation without ExtJS we can change this behavior again.

Resolves: #63591
Releases: master
Change-Id: I4e32013d2d904e1cc4f91f8c9fa9af165fc8c476
Reviewed-on: http://review.typo3.org/39382
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Tested-by: Andreas Fernandez <typo3@scripting-base.de>
Reviewed-by: Benjamin Mack <benni@typo3.org>
Tested-by: Benjamin Mack <benni@typo3.org>
typo3/sysext/backend/Resources/Public/JavaScript/extjs/components/pagetree/javascript/tree.js
typo3/sysext/backend/Resources/Public/JavaScript/extjs/components/pagetree/javascript/treeeditor.js

index f6f111a..22824bf 100644 (file)
@@ -173,25 +173,23 @@ TYPO3.Components.PageTree.Tree = Ext.extend(Ext.tree.TreePanel, {
        listeners: {
                        // single click handler that only triggers after a delay to let the double click event
                        // a possibility to be executed (needed for label edit)
-               click: {
+               dblclick: {
                        fn: function(node, event) {
-                               if (this.clicksRegistered === 2) {
-                                       this.clicksRegistered = 0;
-                                       event.stopEvent();
-                                       return false;
-                               }
+                               this.triggerEdit(node);
+                       }
+               },
 
-                               this.clicksRegistered = 0;
+               click: {
+                       fn: function(node, event) {
                                if (this.commandProvider.singleClick) {
                                        this.commandProvider.singleClick(node, this);
                                }
-                       },
-                       delay: 400
+                       }
                },
 
                        // prevent the expanding / collapsing on double click
                beforedblclick: {
-                       fn: function() {
+                       fn: function(node, event) {
                                return false;
                        }
                },
index 92f9811..9b13f04 100644 (file)
@@ -35,7 +35,7 @@ TYPO3.Components.PageTree.TreeEditor = Ext.extend(Ext.tree.TreeEditor, {
         *
         * @type {int}
         */
-       editDelay: 250,
+       editDelay: 0,
 
        /**
         * Indicates if an underlying shadow should be shown