fix for IS when viewport is short

This commit is contained in:
barisusakli
2015-09-27 00:57:54 -04:00
parent df89a62b32
commit e02781f7e8

View File

@@ -31,10 +31,14 @@ define('forum/infinitescroll', ['translator'], function(translator) {
var top = 20, bottom = 80;
var direction = currentScrollTop > previousScrollTop ? 1 : -1;
if (scrollPercent < top && currentScrollTop < previousScrollTop) {
callback(-1);
callback(direction);
} else if (scrollPercent > bottom && currentScrollTop > previousScrollTop) {
callback(1);
callback(direction);
} else if (scrollPercent < 0 && direction > 0 && viewportHeight < 0) {
callback(direction);
}
previousScrollTop = currentScrollTop;