Autoscroll page table of contents near top of side nav menu if on large screens, but set position to static on small screens to fix display bug
This commit is contained in:
parent
5bcb373c00
commit
2528f35f00
16
doc/toc.html
16
doc/toc.html
@ -8,14 +8,18 @@
|
|||||||
.doco-list-group-item {
|
.doco-list-group-item {
|
||||||
padding-left: 15px;
|
padding-left: 15px;
|
||||||
}
|
}
|
||||||
.widget {
|
#region_1 .widget {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
top:70px;
|
top:70px;
|
||||||
width: inherit;
|
width: inherit;
|
||||||
height: 80%;
|
height: 80%;
|
||||||
overflow-y: scroll;
|
overflow-y: scroll;
|
||||||
}
|
}
|
||||||
|
@media screen and (max-width: 767px) {
|
||||||
|
#region_1 .widget {
|
||||||
|
position: static;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<div class="panel-group" id="accordion">
|
<div class="panel-group" id="accordion">
|
||||||
@ -120,11 +124,13 @@
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
// Generate the table of contents in the side nav menu (see view/tpl/help.tpl)
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
var tocUl = $('#page-toc-container').append('<ul>').find('ul');
|
var tocUl = $('#page-toc-container').append('<ul>').find('ul');
|
||||||
tocUl.removeClass();
|
tocUl.removeClass(); // Classes are automatically added to <ul> elements by something else
|
||||||
tocUl.toc({content: "#doco-content", headings: "h1,h2,h3,h4"});
|
tocUl.toc({content: "#doco-content", headings: "h1,h2,h3,h4"});
|
||||||
|
$('#region_1 .widget').scrollTop($(tocUl).offset().top - $('#accordion').offset().top);
|
||||||
});
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
Reference in New Issue
Block a user