Skip to content

Commit

Permalink
Fixing #30 in a better way ;)
Browse files Browse the repository at this point in the history
  • Loading branch information
FokkeZB committed Oct 14, 2014
1 parent 351e17c commit c6c2dd8
Showing 1 changed file with 13 additions and 16 deletions.
29 changes: 13 additions & 16 deletions controllers/widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,20 @@ function init(parent) {
}

function mark() {

if (list) {

// sectionCount can be 0 on Android?!
var sectionIndex = Math.max(0, parentSymbol.sectionCount - 1);

parentSymbol.setMarker({
sectionIndex: sectionIndex,
itemIndex: parentSymbol.sections[sectionIndex].items.length - 1
});
// sectionCount can be 0 on Android?!
var sectionIndex = Math.max(0, parentSymbol.sectionCount - 1);

parentSymbol.setMarker({
sectionIndex: sectionIndex,
itemIndex: parentSymbol.sections[sectionIndex].items.length - 1
});

} else {
position = null;
}
}

function state(_state, _message) {
Expand Down Expand Up @@ -216,14 +222,6 @@ function _updateMessage(_message) {
}
}

function reinitPosition() {
if (list) {
mark();
} else {
position = null;
}
}

exports.SUCCESS = 1;
exports.ERROR = 0;
exports.DONE = -1;
Expand All @@ -234,4 +232,3 @@ exports.state = state;
exports.dettach = dettach;
exports.init = init;
exports.mark = mark;
exports.reinitPosition = reinitPosition;

0 comments on commit c6c2dd8

Please sign in to comment.