From 7ff58e442b059de2342ac0c21219b092a060a5a4 Mon Sep 17 00:00:00 2001 From: Robert Jackson Date: Thu, 7 Aug 2014 09:12:51 -0400 Subject: [PATCH] Do not loop keyboard nav on content list. --- ghost/admin/routes/posts.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/ghost/admin/routes/posts.js b/ghost/admin/routes/posts.js index e647b6b30b..cfcd211d7a 100644 --- a/ghost/admin/routes/posts.js +++ b/ghost/admin/routes/posts.js @@ -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)); },