From 2ae7e4ddd667dd495f4fb1372cd63d6ba3207ed5 Mon Sep 17 00:00:00 2001 From: Andrew Nicols Date: Mon, 17 Feb 2014 11:33:50 +0800 Subject: [PATCH] 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. --- course/renderer.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/course/renderer.php b/course/renderer.php index b28a98b5b20..aab4174cbcf 100644 --- a/course/renderer.php +++ b/course/renderer.php @@ -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, -- 2.11.4.GIT