Fixed bug #12646: Click on icon does not open/close sections
[Packages/TYPO3.CMS.git] / typo3 / sysext / reports / mod / index.php
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
                                                });