Skip to content

Commit 3cf3e37

Browse files
author
Zane McCaig
committed
Added check for a nativeMaxScroll of 0 in getNativeMaxScroll
1 parent 89c47c2 commit 3cf3e37

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

Diff for: js/angular/controller/infiniteScrollController.js

+8-6
Original file line numberDiff line numberDiff line change
@@ -100,13 +100,15 @@ function($scope, $attrs, $element, $timeout) {
100100
};
101101
var computedStyle = window.getComputedStyle(self.scrollEl) || {};
102102
return {
103-
left: computedStyle.overflowX === 'scroll' ||
104-
computedStyle.overflowX === 'auto' ||
105-
self.scrollEl.style['overflow-x'] === 'scroll' ?
103+
left: maxValues.left &&
104+
(computedStyle.overflowX === 'scroll' ||
105+
computedStyle.overflowX === 'auto' ||
106+
self.scrollEl.style['overflow-x'] === 'scroll') ?
106107
calculateMaxValue(maxValues.left) : -1,
107-
top: computedStyle.overflowY === 'scroll' ||
108-
computedStyle.overflowY === 'auto' ||
109-
self.scrollEl.style['overflow-y'] === 'scroll' ?
108+
top: maxValues.top &&
109+
(computedStyle.overflowY === 'scroll' ||
110+
computedStyle.overflowY === 'auto' ||
111+
self.scrollEl.style['overflow-y'] === 'scroll' ) ?
110112
calculateMaxValue(maxValues.top) : -1
111113
};
112114
};

0 commit comments

Comments
 (0)