Skip to content

Instantly share code, notes, and snippets.

@bloudermilk
Created November 1, 2012 21:12
Show Gist options
  • Save bloudermilk/3996580 to your computer and use it in GitHub Desktop.
Save bloudermilk/3996580 to your computer and use it in GitHub Desktop.
Github-style text areas
# Enables {command,ctrl}+enter on all textareas
# Author: Nick Giancola (@patbenatar)
$ ->
$("textarea").keydown (e) ->
if (e.ctrlKey or e.metaKey) and e.keyCode is 13
$("textarea").closest("form").submit()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment