mirror of
https://github.com/moodle/moodle.git
synced 2025-01-17 13:38:32 +01:00
MDL-73464 book: Scroll to chapter top when navigating through the book
When navigating to the next / previous chapter, the chapter should be the page element that gets the user's attention and focus. Its title should be displayed at the prominent top page area without the need to scroll to it all the time.
This commit is contained in:
parent
d78de537ff
commit
b407af725f
@ -42,12 +42,12 @@
|
||||
<div class="row">
|
||||
{{#previous}}
|
||||
<div class="navitem">
|
||||
<a class="btn btn-secondary" href="{{url}}">{{title}}</a>
|
||||
<a class="btn btn-secondary" href="{{url}}#mod_book-chaptersnavigation">{{title}}</a>
|
||||
</div>
|
||||
{{/previous}}
|
||||
{{#next}}
|
||||
<div class="navitem ml-auto">
|
||||
<a class="btn btn-secondary" href="{{url}}">{{title}}</a>
|
||||
<a class="btn btn-secondary" href="{{url}}#mod_book-chaptersnavigation">{{title}}</a>
|
||||
</div>
|
||||
{{/next}}
|
||||
</div>
|
||||
|
@ -123,7 +123,7 @@ if (!$chapterid) {
|
||||
$renderer = $PAGE->get_renderer('mod_book');
|
||||
$actionmenu = new \mod_book\output\main_action_menu($cm->id, $chapters, $chapter, $book);
|
||||
$renderedmenu = $renderer->render($actionmenu);
|
||||
echo $renderedmenu;
|
||||
echo html_writer::div($renderedmenu, '', ['id' => 'mod_book-chaptersnavigation']);
|
||||
|
||||
// The chapter itself.
|
||||
$hidden = $chapter->hidden ? ' dimmed_text' : null;
|
||||
|
Loading…
x
Reference in New Issue
Block a user