The pagetree now doesn't wait for the AJAX response any more when collapsing
authorIngmar Schlecht <ingmar.schlecht@typo3.org>
Sun, 4 Feb 2007 12:45:14 +0000 (12:45 +0000)
committerIngmar Schlecht <ingmar.schlecht@typo3.org>
Sun, 4 Feb 2007 12:45:14 +0000 (12:45 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@1968 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/tree.js

index d1c9331..a25da81 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2007-02-04  Ingmar Schlecht  <ingmar@typo3.org>
+
+       * Instant collapsing for pagetree: The pagetree now doesn't wait for the AJAX response any more when collapsing
+
 2007-02-03  Oliver Hader  <oh@inpublica.de>
 
        * Fixed feature request: TCEforms/IRRE - Allow TSconfig to override TCA field configuration
index b32a8c7..4296dfc 100755 (executable)
@@ -47,7 +47,17 @@ var Tree = {
                        window.location.href = this.thisScript + '?PM=' + params;
                        return;
                }
-               $(obj).style.cursor = 'wait';
+
+               // immediately collapse the subtree and change the plus to a minus when collapsing
+               // without waiting for the response
+               if (!isExpand) {
+                       $(obj.parentNode.getElementsByTagName('ul')[0]).remove();
+                       var pm = $(obj.parentNode).getElementsByClassName('pm')[0].firstChild;
+                       pm.src = pm.src.replace('minus', 'plus');
+               } else {
+                       obj.style.cursor = 'wait';
+               }
+
                new Ajax.Request(this.thisScript, {
                        method: 'get',
                        parameters: 'ajax=1&PM=' + params,