mirror of
https://github.com/moodle/moodle.git
synced 2025-06-02 22:25:04 +02:00
MDL-43504 Course: Include the course/category collapse JS correctly
This was previously only included when there were hidden categories to show which were not yet visible. As a result, if all categories were visible, then the JS was not included.
This commit is contained in:
parent
b44b0fdab4
commit
2ae7e4ddd6
@ -1583,8 +1583,6 @@ class core_course_renderer extends plugin_renderer_base {
|
||||
$classes[] = 'with_children';
|
||||
$classes[] = 'collapsed';
|
||||
}
|
||||
// Make sure JS file to expand category content is included.
|
||||
$this->coursecat_include_js();
|
||||
} else {
|
||||
// load category content
|
||||
$categorycontent = $this->coursecat_category_content($chelper, $coursecat, $depth);
|
||||
@ -1593,6 +1591,10 @@ class core_course_renderer extends plugin_renderer_base {
|
||||
$classes[] = 'with_children';
|
||||
}
|
||||
}
|
||||
|
||||
// Make sure JS file to expand category content is included.
|
||||
$this->coursecat_include_js();
|
||||
|
||||
$content = html_writer::start_tag('div', array(
|
||||
'class' => join(' ', $classes),
|
||||
'data-categoryid' => $coursecat->id,
|
||||
|
Loading…
x
Reference in New Issue
Block a user