Skip to content
Snippets Groups Projects
Commit 76935f4a authored by Chris Hallberg's avatar Chris Hallberg
Browse files

VuDL fixes to scrolling behaviour and bottom item padding.

parent f50df185
No related merge requests found
......@@ -123,6 +123,9 @@ function scrollToSelected() {
scrollTop: $('#collapse1 .selected').offset().top-$('#collapse1').offset().top+$('#collapse1').scrollTop()-12
});
}
function scrollAdjust() {
$('#collapse1').scrollTop($('#'+topScrollItem).offset().top-$('#collapse1').offset().top+$('#collapse1').scrollTop());
}
// Accordion size
function resizeAccordions(offset) {
var accordionHeight = window.innerHeight // Window height
......@@ -181,6 +184,16 @@ $(document).ready(function() {
$('#side-nav-toggle').click(toggleSideNav);
setTimeout(findVisible, 1000);
ajaxGetView(initPage);
// Track top item in the scroll bar
$('.accordion-body').scroll(function(e){
var pageLinks = $('.page-link');
for(var i=0;i<pageLinks.length;i++) {
if($(pageLinks[i]).position().top >= 0) {
topScrollItem = pageLinks[i].id;
break;
}
}
});
});
// Initial alignment
$( window ).load( scrollToSelected );
......
......@@ -112,7 +112,7 @@
<? endforeach; ?>
<!-- POST LOADING PLACEHOLDERS -->
<? if(isset($this->outline['counts'][$key])): ?>
<? for($i=$this->page+count($list);$i<$this->outline['counts'][$key];$i++): ?>
<? for($i=$this->initPage+count($list);$i<$this->outline['counts'][$key];$i++): ?>
<a class="page-link unloaded" id="item<?=($i) ?>" title="<?=$i ?>">Loading...</a>
<? endfor; ?>
<? endif; ?>
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment