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 5b7fbdb commit 51b833d
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 @@ -1463,8 +1463,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 @@ -1474,6 +1472,10 @@ protected function coursecat_category(coursecat_helper $chelper, $coursecat, $de
$classes[] = 'expanded';
}
}

// 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 51b833d

Please sign in to comment.