Skip to content

Commit 491743b

Browse files
committed
Fixed scroll-load-state loop with fast syncs
1 parent 0afdeb3 commit 491743b

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ The widget automatically shows an *ActivityIndicator* in a *TableView*'s *Footer
2424

2525
```javascript
2626
"dependencies": {
27-
"nl.fokkezb.infiniteScroll":"1.3"
27+
"nl.fokkezb.infiniteScroll":"1.3.1"
2828
}
2929
```
3030

@@ -96,6 +96,8 @@ You can also manually trigger the loading state of the widget. You could use thi
9696
| dettach | | Manually set the `DONE` state and remove the scroll listener
9797

9898
## Changelog
99+
* 1.3.1:
100+
* Fixes scroll-load-state loop with fast syncs.
99101
* 1.3:
100102
* Compatible with iOS7's new `Ti.UI.Window.extendEdges` via `#isCenter`.
101103
* Allows you to hide the text until first load by calling `show` after that

controllers/widget.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,10 @@ function state(_state, _message) {
5252
$.isCenter.add($.isText);
5353
$.isText.show(); // so it can be hidden on init via TSS
5454

55-
loading = false;
55+
// small time-out to prevent scroll-load-state loop with fast syncs
56+
setTimeout(function () {
57+
loading = false;
58+
}, 25);
5659

5760
return true;
5861
}

widget.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"name": "nl.fokkezb.infiniteScroll",
44
"description" : "Scroll down to the end of the TableView to load more.",
55
"author": "Fokke Zandbergen",
6-
"version": "1.3",
6+
"version": "1.3.1",
77
"copyright":"Copyright (c) 2013",
88
"license":"Apache License, Version 2.0",
99
"min-alloy-version": "1.0",

0 commit comments

Comments
 (0)