Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

more cleanup.

  • Loading branch information...
commit 6eb31263b6c5ba9f934f30b4571151c4853629be 1 parent d9ceca2
Mike Cantelon authored
Showing with 4 additions and 4 deletions.
  1. +4 −4 public/javascripts/chat_ui.js
8 public/javascripts/chat_ui.js
View
@@ -27,14 +27,13 @@ function processUserInput(chatApp, socket) {
}
$(document).ready(function() {
- var name
- , chatApp = new Chat(socket);
+ var chatApp = new Chat(socket);
socket.on('nameResult', function(result) {
var message;
+
if (result.success) {
message = 'You are now known as ' + result.name + '.';
- name = result.name;
} else {
message = result.message;
}
@@ -65,7 +64,8 @@ $(document).ready(function() {
chatApp.processCommand(
$('#room').text(),
'/join ' + $(this).text()
- )
+ );
+ $('#send-message').focus();
});
});
Please sign in to comment.
Something went wrong with that request. Please try again.