mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
course-combolist MDL-24315 Fixed issue with collapsible regions triggering on anchor elements
This commit is contained in:
parent
0e4c5b912c
commit
4461a18e73
2 changed files with 5 additions and 5 deletions
|
@ -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));
|
||||
|
|
|
@ -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);
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue