Skip to content

Commit

Permalink
Closes #12 - Adding workaround for regression (https://jira.appcelera…
Browse files Browse the repository at this point in the history
…tor.org/browse/TC-3417) in Alloy 1.3.0-cr
  • Loading branch information
FokkeZB committed Dec 17, 2013
1 parent 29615f0 commit a0a0b2e
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
5 changes: 4 additions & 1 deletion README.md
Expand Up @@ -24,7 +24,7 @@ The widget automatically shows an *ActivityIndicator* in a *TableView*'s *Footer

```javascript
"dependencies": {
"nl.fokkezb.infiniteScroll":"1.3.1"
"nl.fokkezb.infiniteScroll":"1.3.2"
}
```

Expand Down Expand Up @@ -96,8 +96,11 @@ You can also manually trigger the loading state of the widget. You could use thi
| load | | Manually trigger the `end` event and loading state
| state | `state`, `string` | Manually set the state. The first argument should be one of the exported `SUCCESS`, `DONE` and `ERROR` constants. The second optional argument is a custom message to display instead of the message belonging to the state.
| dettach | | Manually set the `DONE` state and remove the scroll listener
| init | `Ti.UI.TableView` | Manually init the widget if it's the child element of the table, or to work around [TC-3417](https://jira.appcelerator.org/browse/TC-3417) in Alloy 1.3.0-cr.

## Changelog
* 1.3.2:
* Workaround for regression in Alloy 1.3.0-cr
* 1.3.1:
* Fixes scroll-load-state loop with fast syncs.
* 1.3:
Expand Down
15 changes: 12 additions & 3 deletions controllers/widget.js
Expand Up @@ -10,9 +10,17 @@ var loading = false,
position = null,
currentState = 1;

init();
// Not in all Alloy versions (1.3.0-cr)
if (__parentSymbol) {
init();
}

function init(_table) {

function init() {
// Override __parentSymbol
if (_table) {
__parentSymbol = _table;
}

// delete special args
delete args.__parentSymbol;
Expand Down Expand Up @@ -160,4 +168,5 @@ exports.DONE = -1;
exports.setOptions = setOptions;
exports.load = load;
exports.state = state;
exports.dettach = dettach;
exports.dettach = dettach;
exports.init = init;
2 changes: 1 addition & 1 deletion widget.json
Expand Up @@ -3,7 +3,7 @@
"name": "nl.fokkezb.infiniteScroll",
"description" : "Scroll down to the end of the TableView to load more.",
"author": "Fokke Zandbergen",
"version": "1.3.1",
"version": "1.3.2",
"copyright":"Copyright (c) 2013",
"license":"Apache License, Version 2.0",
"min-alloy-version": "1.0",
Expand Down

0 comments on commit a0a0b2e

Please sign in to comment.