diff --git a/themes/bootstrap3/js/vudl/record.js b/themes/bootstrap3/js/vudl/record.js index dfd1ce9412dcf7b438efe289dbc4be21565b596f..24d2c76e5cc404319d5c9c3e103d62199c50e8d6 100644 --- a/themes/bootstrap3/js/vudl/record.js +++ b/themes/bootstrap3/js/vudl/record.js @@ -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 ); diff --git a/themes/bootstrap3/templates/vudl/record.phtml b/themes/bootstrap3/templates/vudl/record.phtml index 722aa026dae7536c82483af5934877eef0383381..6a6d40d7be550d4459be64a9479a8324aa01b8ed 100644 --- a/themes/bootstrap3/templates/vudl/record.phtml +++ b/themes/bootstrap3/templates/vudl/record.phtml @@ -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; ?>