Skip to content

Commit

Permalink
Do not loop keyboard nav on content list.
Browse files Browse the repository at this point in the history
  • Loading branch information
rwjblue committed Aug 7, 2014
1 parent 4b83dfd commit b7b797e
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions core/client/routes/posts.js
Expand Up @@ -44,12 +44,13 @@ var PostsRoute = Ember.Route.extend(SimpleAuth.AuthenticatedRouteMixin, Shortcut

newPosition = posts.indexOf(currentPost) + step;

//Make sure we're inbounds
// if we are on the first or last item
// just do nothing (desired behavior is to not
// loop around)
if (newPosition >= length) {
newPosition = 0;
}
else if (newPosition < 0) {
newPosition = length - 1;
return;
} else if (newPosition < 0) {
return;
}
this.transitionTo('posts.post', posts.objectAt(newPosition));
},
Expand Down

0 comments on commit b7b797e

Please sign in to comment.