course-combolist MDL-24315 Fixed issue with collapsible regions triggering on anchor...
authorSam Hemelryk <sam@moodle.com>
Tue, 21 Sep 2010 10:04:23 +0000 (10:04 +0000)
committerSam Hemelryk <sam@moodle.com>
Tue, 21 Sep 2010 10:04:23 +0000 (10:04 +0000)
course/renderer.php
lib/javascript-static.js

index fbdf922..4e097d1 100644 (file)
@@ -66,7 +66,7 @@ class core_course_renderer extends plugin_renderer_base {
 
         // Generate an id and the required JS call to make this a nice widget
         $id = html_writer::random_id('course_category_tree');
-        $this->page->requires->js_init_call('M.util.init_toggle_class_on_click', array($id, '.category.with_children', 'collapsed'));
+        $this->page->requires->js_init_call('M.util.init_toggle_class_on_click', array($id, '.category.with_children .category_label', 'collapsed'));
 
         // Start content generation
         $content = html_writer::start_tag('div', array('class'=>'course_category_tree', 'id'=>$id));
index 1776d3a..f2a746b 100644 (file)
@@ -411,8 +411,8 @@ M.util.init_toggle_class_on_click = function(Y, id, cssselector, toggleclassname
     node.all(cssselector).each(function(node){
         node.on('click', function(e){
             e.stopPropagation();
-            if (e.target.get('nodeName')!='A' && e.target.get('nodeName')!='IMG') {
-                this.toggleClass(toggleclassname);
+            if (e.target.test(cssselector) && e.target.get('nodeName')!='A' && e.target.get('nodeName')!='IMG') {
+                this.ancestor().toggleClass(toggleclassname);
             }
         }, node);
     });
@@ -1538,7 +1538,7 @@ M.util.init_mp3flowplayer = function (id, playerpath, audioplayerpath, fileurl,
                     },
                     audio: {url: audioplayerpath}
             },
-            clip: { url: fileurl,
+            clip: {url: fileurl,
                     provider: "audio",
                     autoPlay: false
             }
@@ -1565,7 +1565,7 @@ M.util.init_mp3flowplayerplugin = function (id, playerpath, audioplayerpath, fil
                     },
                     audio: {url: audioplayerpath}
             },
-            clip: { url: fileurl,
+            clip: {url: fileurl,
                     provider: "audio",
                     autoPlay: false
             }