darsain / sly

JavaScript library for one-directional scrolling with item based navigation support.
http://darsa.in/sly
2.87k stars 496 forks source link

Add items with position fails #141

Closed imaximix closed 10 years ago

imaximix commented 10 years ago

Calling add() with the position parameter equal to items.length will fail.

I think that instead of

if (index == null || !items[0]) {
  $element.appendTo($slidee);
}

there should be

if (index == null || !items[0] || items.length === index) {
  $element.appendTo($slidee);
}
darsain commented 10 years ago

Thx for the report! Finally had time to catch up with this repo a little :)