Fixed bug #17702: Directly open "inline edit" of page title after creating a new...
authorsteffenk <steffenk@709f56b5-9817-0410-a4d7-c38de5d9e867>
Wed, 23 Feb 2011 12:42:28 +0000 (12:42 +0000)
committersteffenk <steffenk@709f56b5-9817-0410-a4d7-c38de5d9e867>
Wed, 23 Feb 2011 12:42:28 +0000 (12:42 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@10588 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/js/extjs/components/pagetree/javascript/actions.js
t3lib/js/extjs/components/pagetree/javascript/tree.js

index 5736bac..3bb4020 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
+2011-02-23  Steffen Kamper  <steffen@typo3.org>
+
+       * Fixed bug #17702: Directly open "inline edit" of page title after creating a new page with drag and drop in the pagetree (Thanks to Stefan Galinski)
+
 2011-02-23  Ernesto Baschny  <ernst@cron-it.de>
+
        * Fixed bug #17314: Swift_RfcComplianceException is always thrown in t3lib_formmail when forceReturnPath=1 is set
 
 2011-02-23  Tolleiv Nietsch  <typo3@tolleiv.de>
index a644ec0..ed7bdcb 100644 (file)
@@ -74,9 +74,10 @@ TYPO3.Components.PageTree.Actions = {
         * @param {Ext.tree.TreeNode} node
         * @param {Boolean} isExpanded
         * @param {Object} updatedNode
+        * @param {Function} callback
         * @return {Ext.tree.TreeNode}
         */
-       updateNode: function(node, isExpanded, updatedNode) {
+       updateNode: function(node, isExpanded, updatedNode, callback) {
                if (!updatedNode) {
                        return null;
                }
@@ -84,19 +85,33 @@ TYPO3.Components.PageTree.Actions = {
                updatedNode.uiProvider = node.ownerTree.uiProvider;
                var newTreeNode = new Ext.tree.TreeNode(updatedNode);
 
+               var refreshCallback = this.restoreNodeStateAfterRefresh;
+               if (callback) {
+                       refreshCallback = refreshCallback.createSequence(callback);
+               }
+
                node.parentNode.replaceChild(newTreeNode, node);
-               newTreeNode.ownerTree.refreshNode(newTreeNode, function() {
-                       newTreeNode.parentNode.expand(false, false);
-                       if (isExpanded) {
-                               newTreeNode.expand(false, false);
-                       } else {
-                               newTreeNode.collapse(false, false);
-                       }
-               });
+               newTreeNode.ownerTree.refreshNode(newTreeNode, refreshCallback);
 
                return newTreeNode;
        },
 
+       /**
+        * Restores the node state
+        *
+        * @param {Ext.tree.TreeNode} node
+        * @param {Boolean} isExpanded
+        * @return {void}
+        */
+       restoreNodeStateAfterRefresh: function(node, isExpanded) {
+               node.parentNode.expand(false, false);
+               if (isExpanded) {
+                       node.expand(false, false);
+               } else {
+                       node.collapse(false, false);
+               }
+       },
+
        /**
         * Shows deletion confirmation window
         *
@@ -551,7 +566,9 @@ TYPO3.Components.PageTree.Actions = {
                        tree.t3ContextInfo.serverNodeType,
                        function(response) {
                                if (this.evaluateResponse(response)) {
-                                       this.updateNode(node, node.isExpanded(), response);
+                                       this.updateNode(node, node.isExpanded(), response, function(node) {
+                                               tree.triggerEdit(node);
+                                       });
                                }
                                this.releaseCutAndCopyModes(tree);
                        },
@@ -572,7 +589,9 @@ TYPO3.Components.PageTree.Actions = {
                        tree.t3ContextInfo.serverNodeType,
                        function(response) {
                                if (this.evaluateResponse(response)) {
-                                       node = this.updateNode(node, true, response);
+                                       this.updateNode(node, true, response, function(node) {
+                                               tree.triggerEdit(node);
+                                       });
                                }
                                this.releaseCutAndCopyModes(tree);
                        },
@@ -593,7 +612,9 @@ TYPO3.Components.PageTree.Actions = {
                        node.previousSibling.attributes.nodeData.id,
                        function(response) {
                                if (this.evaluateResponse(response)) {
-                                       this.updateNode(node, true, response);
+                                       this.updateNode(node, true, response, function(node) {
+                                               tree.triggerEdit(node);
+                                       });
                                }
                                this.releaseCutAndCopyModes(tree);
                        },
@@ -614,7 +635,9 @@ TYPO3.Components.PageTree.Actions = {
                        node.parentNode.attributes.nodeData.id,
                        function(response) {
                                if (this.evaluateResponse(response)) {
-                                       this.updateNode(node, true, response);
+                                       this.updateNode(node, true, response, function(node) {
+                                               tree.triggerEdit(node);
+                                       });
                                }
                                this.releaseCutAndCopyModes(tree);
                        },
index c7bc06b..28618a4 100644 (file)
@@ -49,6 +49,13 @@ TYPO3.Components.PageTree.Tree = Ext.extend(Ext.tree.TreePanel, {
         */
        rootVisible: false,
 
+       /**
+        * Tree Editor Instance (Inline Edit)
+        *
+        * @type {TYPO3.Components.PageTree.TreeEditor}
+        */
+       treeEditor: null,
+
        /**
         * Enable the drag and drop feature
         *
@@ -365,7 +372,19 @@ TYPO3.Components.PageTree.Tree = Ext.extend(Ext.tree.TreePanel, {
         * @return {void}
         */
        enableInlineEditor: function() {
-               (new TYPO3.Components.PageTree.TreeEditor(this));
+               this.treeEditor = new TYPO3.Components.PageTree.TreeEditor(this);
+       },
+
+       /**
+        * Triggers the editing of the node if the tree editor is available
+        *
+        * @param {Ext.tree.TreeNode} node
+        * @return {void}
+        */
+       triggerEdit: function(node) {
+               if (this.treeEditor) {
+                       this.treeEditor.triggerEdit(node);
+               }
        },
 
        /**
@@ -443,7 +462,7 @@ TYPO3.Components.PageTree.Tree = Ext.extend(Ext.tree.TreePanel, {
         * Enables the deletion drop zone if configured. Also it creates the
         * shown dd proxy element.
         *
-        * @param {TYPO3.Components.PageTree.Tree} treePane
+        * @param {TYPO3.Components.PageTree.Tree} treePanel
         * @param {Ext.tree.TreeNode} node
         * @return {void}
         */