Commits

Miki Tebeka committed ac9a253

Name as hook

  • Participants
  • Parent commits 5cbfd12

Comments (0)

Files changed (1)

File war/static/site.js

     $.post('/shorten', {url: url}, on_shortened);
 }
 
+function hook_enter_key() {
+    $('body').keyup(function(e) {
+        if (e.keyCode == 13) {
+            on_shorten();
+        }
+    })
+}
+
 $(document).ready(function() {
     $('#shorten').click(on_shorten);
+    hook_enter_key();
 });