From c5b30b39de1dde457ead36fc5263ac59a143a504 Mon Sep 17 00:00:00 2001 From: danielgrippi Date: Fri, 24 Feb 2012 22:47:00 -0800 Subject: [PATCH] don't page nav when focused in the comment box --- public/javascripts/app/pages/post-viewer.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/public/javascripts/app/pages/post-viewer.js b/public/javascripts/app/pages/post-viewer.js index 58ea172f6..0a243397c 100644 --- a/public/javascripts/app/pages/post-viewer.js +++ b/public/javascripts/app/pages/post-viewer.js @@ -55,8 +55,13 @@ app.pages.PostViewer = app.views.Base.extend({ var nextPostLocation = this.model.get("next_post"); var previousPostLocation = this.model.get("previous_post"); - $(document).keydown(function(e){ - switch(e.keyCode) { + + $(document).keydown(function(evt){ + /* prevent nav from happening if the user is using the arrow + * keys to navigate through their comment text */ + if($(evt.target).is("textarea")) { return } + + switch(evt.keyCode) { case 37: navigate(nextPostLocation); break; case 39: