Skip to content

Commit 6138240

Browse files
author
Emmanuel Garcia
authored
Merge pull request #17 from PolymerElements/issue-16
Fix #16
2 parents 472770a + d03eccb commit 6138240

File tree

2 files changed

+17
-12
lines changed

2 files changed

+17
-12
lines changed

iron-scroll-threshold.html

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@
167167
var THROTTLE_THRESHOLD = 200;
168168
if (!this.isDebouncerActive('_checkTheshold')) {
169169
this.debounce('_checkTheshold', function() {
170-
this.checkScrollThesholds();
170+
this.checkScrollThresholds();
171171
}, THROTTLE_THRESHOLD);
172172
}
173173
},
@@ -176,7 +176,7 @@
176176
if (isAttached) {
177177
this.debounce('_init', function() {
178178
this.clearTriggers();
179-
this.checkScrollThesholds();
179+
this.checkScrollThresholds();
180180
});
181181
}
182182
},
@@ -185,9 +185,9 @@
185185
* Checks the scroll thresholds.
186186
* This method is automatically called by iron-scroll-threshold.
187187
*
188-
* @method checkScrollThesholds
188+
* @method checkScrollThresholds
189189
*/
190-
checkScrollThesholds: function() {
190+
checkScrollThresholds: function() {
191191
if (!this.scrollTarget || (this.lowerTriggered && this.upperTriggered)) {
192192
return;
193193
}
@@ -208,6 +208,11 @@
208208
}
209209
},
210210

211+
checkScrollThesholds: function() {
212+
// iron-scroll-threshold/issues/16
213+
this.checkScrollThresholds();
214+
},
215+
211216
/**
212217
* Clear the upper and lower threshold states.
213218
*

test/basic.html

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -106,12 +106,12 @@
106106
});
107107
});
108108

109-
test('checkScrollThesholds', function(done) {
109+
test('checkScrollThresholds', function(done) {
110110
flush(function() {
111111
scrollThreshold._scrollTop = scrollThreshold.scrollTarget.scrollHeight;
112112

113113
assert.isFalse(scrollThreshold.lowerTriggered, 'check assumption');
114-
scrollThreshold.checkScrollThesholds();
114+
scrollThreshold.checkScrollThresholds();
115115
assert.isTrue(scrollThreshold.lowerTriggered, 'check triggers');
116116
scrollThreshold.clearTriggers();
117117
assert.isFalse(scrollThreshold.lowerTriggered, 'reset triggers');
@@ -126,10 +126,10 @@
126126
scrollThreshold._scrollLeft = scrollThreshold.scrollTarget.scrollWidth;
127127

128128
assert.isFalse(scrollThreshold.lowerTriggered, 'check assumption');
129-
scrollThreshold.checkScrollThesholds();
129+
scrollThreshold.checkScrollThresholds();
130130
assert.isTrue(scrollThreshold.lowerTriggered, 'check lowerTriggered');
131131
scrollThreshold._scrollLeft = 0;
132-
scrollThreshold.checkScrollThesholds();
132+
scrollThreshold.checkScrollThresholds();
133133
assert.isTrue(scrollThreshold.upperTriggered, 'upperTriggered');
134134
done();
135135
});
@@ -187,12 +187,12 @@
187187
});
188188
});
189189

190-
test('checkScrollThesholds', function(done) {
190+
test('checkScrollThresholds', function(done) {
191191
flush(function() {
192192
scrollThreshold._scrollTop = scrollThreshold.scrollTarget.scrollHeight;
193193

194194
assert.isFalse(scrollThreshold.lowerTriggered, 'check assumption');
195-
scrollThreshold.checkScrollThesholds();
195+
scrollThreshold.checkScrollThresholds();
196196
assert.isTrue(scrollThreshold.lowerTriggered, 'check triggers');
197197
scrollThreshold.clearTriggers();
198198
assert.isFalse(scrollThreshold.lowerTriggered, 'reset triggers');
@@ -207,10 +207,10 @@
207207
scrollThreshold._scrollLeft = scrollThreshold.scrollTarget.scrollWidth;
208208

209209
assert.isFalse(scrollThreshold.lowerTriggered, 'check assumption');
210-
scrollThreshold.checkScrollThesholds();
210+
scrollThreshold.checkScrollThresholds();
211211
assert.isTrue(scrollThreshold.lowerTriggered, 'check lowerTriggered');
212212
scrollThreshold._scrollLeft = 0;
213-
scrollThreshold.checkScrollThesholds();
213+
scrollThreshold.checkScrollThresholds();
214214
assert.isTrue(scrollThreshold.upperTriggered, 'upperTriggered');
215215
done();
216216
});

0 commit comments

Comments
 (0)