Skip to content
This repository has been archived by the owner on Nov 10, 2017. It is now read-only.

Commit

Permalink
bug 1092339 - fixed logviewer infinite scrolling
Browse files Browse the repository at this point in the history
  • Loading branch information
Cameron Dawson committed Nov 7, 2014
1 parent 5b2de77 commit 3630e54
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
5 changes: 2 additions & 3 deletions webapp/app/js/directives/log_viewer_infinite_scroll.js
Expand Up @@ -9,18 +9,17 @@ treeherder.directive('lvInfiniteScroll', ['$timeout', '$parse', function ($timeo
element.bind('scroll', function () {
var raw = element[0];
var sh = raw.scrollHeight;
var onLoadMore = $parse(attr.onLoadMore);

if (raw.scrollTop <= 100) {
onLoadMore(scope, {bounds: {top: true}, element: raw}).then(function(haltScrollTop) {
scope.loadMore({top: true}, raw).then(function(haltScrollTop) {
if (!haltScrollTop) {
$timeout(function() {
raw.scrollTop = raw.scrollHeight - sh;
});
}
});
} else if (raw.scrollTop >= (raw.scrollHeight - $(element).height() - 100)) {
onLoadMore(scope, {bounds: {bottom: true}, element: raw});
scope.loadMore({bottom: true}, raw);
}
});
};
Expand Down
1 change: 0 additions & 1 deletion webapp/app/logviewer.html
Expand Up @@ -35,7 +35,6 @@
</div>

<div class="lv-log-container"
on-load-more="loadMore(bounds, element)"
lv-infinite-scroll
lv-log-lines="displayedLogLines">
</div>
Expand Down

0 comments on commit 3630e54

Please sign in to comment.