Created
November 24, 2012 16:35
-
-
Save syron/4140413 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var shiftIsPressed = false; | |
$("#LogAddForm textarea").keyup(function(e) { | |
if (e.keyCode === 16) shiftIsPressed = false; | |
}); | |
$("#LogAddForm textarea").keydown(function(e) { | |
if (e.keyCode === 16) shiftIsPressed = true; | |
if (e.keyCode === 13 && !shiftIsPressed) { | |
$("#LogAddForm").submit(); | |
return false; | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment