MDL-41788 theme_bootstrapbase: Custom menus - sub-menus breaking.

This commit is contained in:
Gareth J Barnard 2013-12-19 12:08:50 +00:00
parent 2f4e0db7c3
commit ce65578510
3 changed files with 15 additions and 10 deletions

View File

@ -176,10 +176,9 @@ img.icon-pre {
}
// Extends bootstrapbase/less/bootstrap/navbar.less
// to enable scroll in longer menus especially language menu.
.open > .dropdown-menu {
// to enable scroll in the language menu.
.langmenu.open > .dropdown-menu {
display: block;
max-height: 500px;
max-height: 150px;
overflow-y: auto;
}

View File

@ -24,6 +24,9 @@
class theme_bootstrapbase_core_renderer extends core_renderer {
/** @var custom_menu_item language The language menu if created */
protected $language = null;
/*
* This renders a notification message.
* Uses bootstrap compatible html.
@ -102,9 +105,9 @@ class theme_bootstrapbase_core_renderer extends core_renderer {
}
if ($addlangmenu) {
$language = $menu->add(get_string('language'), new moodle_url('#'), get_string('language'), 10000);
$this->language = $menu->add(get_string('language'), new moodle_url('#'), get_string('language'), 10000);
foreach ($langs as $langtype => $langname) {
$language->add($langname, new moodle_url($this->page->url, array('lang' => $langtype)), $langname);
$this->language->add($langname, new moodle_url($this->page->url, array('lang' => $langtype)), $langname);
}
}
@ -126,12 +129,15 @@ class theme_bootstrapbase_core_renderer extends core_renderer {
if ($menunode->has_children()) {
if ($level == 1) {
$dropdowntype = 'dropdown';
$class = 'dropdown';
} else {
$dropdowntype = 'dropdown-submenu';
$class = 'dropdown-submenu';
}
$content = html_writer::start_tag('li', array('class'=>$dropdowntype));
if ($menunode === $this->language) {
$class .= ' langmenu';
}
$content = html_writer::start_tag('li', array('class' => $class));
// If the child has menus render it as a sub menu.
$submenucount++;
if ($menunode->get_url() !== null) {

File diff suppressed because one or more lines are too long