Fixed bug #17407: Pagetree cause endless loop in ExtJS events
authorSteffen Kamper <info@sk-typo3.de>
Thu, 3 Feb 2011 23:02:50 +0000 (23:02 +0000)
committerSteffen Kamper <info@sk-typo3.de>
Thu, 3 Feb 2011 23:02:50 +0000 (23:02 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/branches/TYPO3_4-5@10380 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/js/extjs/components/pagetree/javascript/app.js
t3lib/js/extjs/components/pagetree/javascript/deletiondropzone.js
t3lib/js/extjs/components/pagetree/javascript/tree.js

index 62420fb..c86b710 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2011-02-03  Steffen Kamper  <steffen@typo3.org>
+
+       * Fixed bug #17407: Pagetree cause endless loop in ExtJS events
+
 2011-02-02  Steffen Kamper  <steffen@typo3.org>
 
        * Fixed bug #17434: Pagetree: when start edit, the text should be selected
index 1c2489d..58d328d 100644 (file)
@@ -64,23 +64,6 @@ TYPO3.Components.PageTree.App = Ext.extend(Ext.Panel, {
        activeTree: null,
 
        /**
-        * Listeners
-        *
-        * The afterlayout wizard relayoutes the navigation container to fix some nasty
-        * scrollbar issues.
-        *
-        * @type {Object}
-        */
-       listeners: {
-               afterlayout: {
-                       fn: function() {
-                               this.ownerCt.doLayout();
-                       },
-                       buffer: 250
-               }
-       },
-
-       /**
         * Initializes the application
         *
         * Set's the necessary language labels, configuration options and sprite icons by an
@@ -187,6 +170,11 @@ TYPO3.Components.PageTree.App = Ext.extend(Ext.Panel, {
                        if (TYPO3.Components.PageTree.Configuration.indicator !== '') {
                                this.addIndicatorItems();
                        }
+                       this.doLayout();
+
+                       this.ownerCt.on('resize', function() {
+                               this.doLayout();
+                       });
                }, this);
 
                TYPO3.Components.PageTree.App.superclass.initComponent.apply(this, arguments);
@@ -269,11 +257,15 @@ TYPO3.Components.PageTree.App = Ext.extend(Ext.Panel, {
                        }
 
                        component.listeners.afterrender = {
+                               scope: this,
                                fn: this.afterTopPanelItemAdded
                        }
                }
 
-               return Ext.getCmp(this.id + '-indicatorBar').add(component);
+               var indicator = Ext.getCmp(this.id + '-indicatorBar').add(component);
+               this.doLayout();
+               
+               return indicator;
        },
 
        /**
@@ -285,6 +277,7 @@ TYPO3.Components.PageTree.App = Ext.extend(Ext.Panel, {
        afterTopPanelItemAdded: function(component) {
                var topPanelItems = Ext.getCmp(this.id + '-topPanelItems');
                topPanelItems.setHeight(topPanelItems.getHeight() + component.getHeight() + 3);
+               this.doLayout();
        },
 
        /**
@@ -297,6 +290,7 @@ TYPO3.Components.PageTree.App = Ext.extend(Ext.Panel, {
                var topPanelItems = Ext.getCmp(this.id + '-topPanelItems');
                topPanelItems.setHeight(topPanelItems.getHeight() - component.getHeight() - 3);
                Ext.getCmp(this.id + '-indicatorBar').remove(component);
+               this.doLayout();
        },
 
        /**
index a5a2ea7..68000c3 100644 (file)
@@ -215,6 +215,7 @@ TYPO3.Components.PageTree.DeletionDropZone = Ext.extend(Ext.Panel, {
                        '</span>',
                        false
                );
+               this.app.doLayout();
 
                ++this.amountOfDrops;
                (function() {
@@ -289,6 +290,7 @@ TYPO3.Components.PageTree.DeletionDropZone = Ext.extend(Ext.Panel, {
                this.setHeight(35);
                this.updateText(TYPO3.Components.PageTree.LLL.dropToRemove, false);
                this.updateIcon(TYPO3.Components.PageTree.Sprites.TrashCan);
+               this.app.doLayout();
        },
 
        /**
@@ -306,6 +308,7 @@ TYPO3.Components.PageTree.DeletionDropZone = Ext.extend(Ext.Panel, {
                }
                this.setHeight(35);
                this.updateText(TYPO3.Components.PageTree.LLL.dropZoneElementRestored);
+               this.app.doLayout();
 
                (function() {
                        if (this.textClickHandler) {
index 06c695c..c7bc06b 100644 (file)
@@ -107,7 +107,7 @@ TYPO3.Components.PageTree.Tree = Ext.extend(Ext.tree.TreePanel, {
 
        /**
         * Main applicaton
-        * 
+        *
         * @cfg {TYPO3.Components.PageTree.App}
         */
        app: null,
@@ -435,6 +435,7 @@ TYPO3.Components.PageTree.Tree = Ext.extend(Ext.tree.TreePanel, {
        stopDd: function() {
                if (this.deletionDropZoneId) {
                        Ext.getCmp(this.deletionDropZoneId).hide();
+                       this.app.doLayout();
                }
        },
 
@@ -453,6 +454,7 @@ TYPO3.Components.PageTree.Tree = Ext.extend(Ext.tree.TreePanel, {
                        (nodeHasChildNodes && TYPO3.Components.PageTree.Configuration.canDeleteRecursivly)
                )) {
                        Ext.getCmp(this.deletionDropZoneId).show();
+                       this.app.doLayout();
                }
                this.initDDProxyElement();
        },