course-combolist MDL-24315 Fixed issue with collapsible regions triggering on anchor elements

This commit is contained in:
Sam Hemelryk 2010-09-21 10:04:23 +00:00
parent 0e4c5b912c
commit 4461a18e73
2 changed files with 5 additions and 5 deletions

View 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 // Generate an id and the required JS call to make this a nice widget
$id = html_writer::random_id('course_category_tree'); $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 // Start content generation
$content = html_writer::start_tag('div', array('class'=>'course_category_tree', 'id'=>$id)); $content = html_writer::start_tag('div', array('class'=>'course_category_tree', 'id'=>$id));

View file

@ -411,8 +411,8 @@ M.util.init_toggle_class_on_click = function(Y, id, cssselector, toggleclassname
node.all(cssselector).each(function(node){ node.all(cssselector).each(function(node){
node.on('click', function(e){ node.on('click', function(e){
e.stopPropagation(); e.stopPropagation();
if (e.target.get('nodeName')!='A' && e.target.get('nodeName')!='IMG') { if (e.target.test(cssselector) && e.target.get('nodeName')!='A' && e.target.get('nodeName')!='IMG') {
this.toggleClass(toggleclassname); this.ancestor().toggleClass(toggleclassname);
} }
}, node); }, node);
}); });
@ -1538,7 +1538,7 @@ M.util.init_mp3flowplayer = function (id, playerpath, audioplayerpath, fileurl,
}, },
audio: {url: audioplayerpath} audio: {url: audioplayerpath}
}, },
clip: { url: fileurl, clip: {url: fileurl,
provider: "audio", provider: "audio",
autoPlay: false autoPlay: false
} }
@ -1565,7 +1565,7 @@ M.util.init_mp3flowplayerplugin = function (id, playerpath, audioplayerpath, fil
}, },
audio: {url: audioplayerpath} audio: {url: audioplayerpath}
}, },
clip: { url: fileurl, clip: {url: fileurl,
provider: "audio", provider: "audio",
autoPlay: false autoPlay: false
} }