Fixed bug #12646: Click on icon does not open/close sections
authorSteffen Kamper <info@sk-typo3.de>
Thu, 5 Aug 2010 22:37:58 +0000 (22:37 +0000)
committerSteffen Kamper <info@sk-typo3.de>
Thu, 5 Aug 2010 22:37:58 +0000 (22:37 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@8501 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/sysext/reports/mod/index.php

index c5b3f16..1672fb4 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2010-08-05  Steffen Kamper  <steffen@typo3.org>
+
+       * Fixed bug #12646: Click on icon does not open/close sections
+
 2010-08-05  Steffen Gebert  <steffen@steffen-gebert.de>
 
        * Fixed bug #14773: Styling issue when selecting position of new created page
index ebfa3b2..ee69a6c 100644 (file)
@@ -113,8 +113,12 @@ class tx_reports_Module extends t3lib_SCbase {
                                }
                                var state;
                                Event.observe(document, "dom:loaded", function(){
-                                       $$(".section-header").invoke("observe", "click", function(event){
+                                       $$("h2.section-header").invoke("observe", "click", function(event){
                                                var item = Event.element(event);
+                                                       // possible icon inside h2
+                                               if (item.hasClassName("t3-icon")) {
+                                                       item = item.up("h2");
+                                               }
                                                if (item.hasClassName("expanded")) {
                                                        item.removeClassName("expanded").addClassName("collapsed");
                                                        Effect.BlindUp(item.next("div"), {duration : 0.5});
@@ -124,6 +128,7 @@ class tx_reports_Module extends t3lib_SCbase {
                                                        Effect.BlindDown(item.next("div"), {duration : 0.5});
                                                        state = 0;
                                                }
+                                               event.stop();
                                                new Ajax.Request("ajax.php", {
                                                        parameters : "ajaxID=Reports::saveCollapseState&item=" + item.id + "&state=" + state
                                                });