Skip to content

Commit

Permalink
Merge branch 'wip-MDL-41788_master_3' of git://github.com/gjb2048/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam Hemelryk committed Dec 23, 2013
2 parents c4edcce + ce65578 commit 69f86e8
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
7 changes: 3 additions & 4 deletions theme/bootstrapbase/less/moodle/undo.less
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
16 changes: 11 additions & 5 deletions theme/bootstrapbase/renderers/core_renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -102,9 +105,9 @@ protected function render_custom_menu(custom_menu $menu) {
}

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);
}
}

Expand All @@ -126,12 +129,15 @@ protected function render_custom_menu_item(custom_menu_item $menunode, $level =
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) {
Expand Down
2 changes: 1 addition & 1 deletion theme/bootstrapbase/style/moodle.css

Large diffs are not rendered by default.

0 comments on commit 69f86e8

Please sign in to comment.