don't page nav when focused in the comment box

This commit is contained in:
danielgrippi 2012-02-24 22:47:00 -08:00
parent 2ee329d786
commit c5b30b39de

View file

@ -55,8 +55,13 @@ app.pages.PostViewer = app.views.Base.extend({
var nextPostLocation = this.model.get("next_post"); var nextPostLocation = this.model.get("next_post");
var previousPostLocation = this.model.get("previous_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: case 37:
navigate(nextPostLocation); break; navigate(nextPostLocation); break;
case 39: case 39: