Permalink
Browse files

Tweaked handling of form.

  • Loading branch information...
1 parent 0bb45f1 commit de2dc869974c33645a59236f79b71a67e1846035 @dshaw dshaw committed Aug 28, 2010
Showing with 8 additions and 1 deletion.
  1. +3 −0 .gitignore
  2. +5 −1 public/js/chat.js
View
@@ -0,0 +1,3 @@
+config.json
+.DS_Store
+.idea
View
@@ -52,7 +52,7 @@ var console = console || {
function submitty(event) {
event.preventDefault();
- if (!handlemaker.value.length) {
+ if (handlemaker.value.length) {
handlemaker.username = handlemaker.value;
if ("placeholder" in handlemaker) {
handlemaker.placeholder = handlemaker.username;
@@ -62,14 +62,18 @@ var console = console || {
msg : handlemaker.value
}));
handlemaker.value = "";
+ handlemaker.blur();
}
if (chatterbox.value.length) {
socket.send(JSON.stringify({
type : "chat",
msg : chatterbox.value
}));
chatterbox.value = "";
+ chatterbox.blur();
}
+
+ this.blur();
return false;
}

0 comments on commit de2dc86

Please sign in to comment.