mirror of
https://github.com/moodle/moodle.git
synced 2025-04-27 03:14:20 +02:00
MDL-46470 bootstrapbase: support linkedwhenselected attribute for tabs
This commit is contained in:
parent
d29fb4ac65
commit
921390f103
@ -130,16 +130,18 @@
|
||||
}
|
||||
}
|
||||
// Active state, and it's :hover/:focus to override normal :hover/:focus
|
||||
.nav-tabs > .active > a,
|
||||
.nav-tabs > .active > a:hover,
|
||||
.nav-tabs > .active > a:focus {
|
||||
color: @gray;
|
||||
.nav-tabs > .active > a {
|
||||
background-color: @bodyBackground;
|
||||
border: 1px solid #ddd;
|
||||
border-bottom-color: transparent;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.nav-tabs > .active > a:not([href]),
|
||||
.nav-tabs > .active > a:not([href]):hover,
|
||||
.nav-tabs > .active > a:not([href]):focus {
|
||||
color: @gray;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
// PILLS
|
||||
// -----
|
||||
|
@ -217,7 +217,7 @@ class theme_bootstrapbase_core_renderer extends core_renderer {
|
||||
* @return string HTML fragment
|
||||
*/
|
||||
protected function render_tabobject(tabobject $tab) {
|
||||
if ($tab->selected or $tab->activated) {
|
||||
if (($tab->selected and (!$tab->linkedwhenselected)) or $tab->activated) {
|
||||
return html_writer::tag('li', html_writer::tag('a', $tab->text), array('class' => 'active'));
|
||||
} else if ($tab->inactive) {
|
||||
return html_writer::tag('li', html_writer::tag('a', $tab->text), array('class' => 'disabled'));
|
||||
@ -228,7 +228,8 @@ class theme_bootstrapbase_core_renderer extends core_renderer {
|
||||
} else {
|
||||
$link = html_writer::link($tab->link, $tab->text, array('title' => $tab->title));
|
||||
}
|
||||
return html_writer::tag('li', $link);
|
||||
$params = $tab->selected ? array('class' => 'active') : null;
|
||||
return html_writer::tag('li', $link, $params);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user