Skip to content

Commit

Permalink
MDL-43504 Course: Include the course/category collapse JS correctly
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
andrewnicols committed Feb 17, 2014
1 parent b44b0fd commit 2ae7e4d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions course/renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -1583,8 +1583,6 @@ protected function coursecat_category(coursecat_helper $chelper, $coursecat, $de
$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);
Expand All @@ -1593,6 +1591,10 @@ protected function coursecat_category(coursecat_helper $chelper, $coursecat, $de
$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,
Expand Down

0 comments on commit 2ae7e4d

Please sign in to comment.