Bind enter to the send button in the chat UI

Thu, 08 Apr 2010 16:41:23 +0100

author
Matthew Wild <mwild1@gmail.com>
date
Thu, 08 Apr 2010 16:41:23 +0100
changeset 50
53bfdcb686f7
parent 49
6d46d2518705
child 51
7f893f429760

Bind enter to the send button in the chat UI

support-chat/js/supportchat.js file | annotate | diff | comparison | revisions
--- a/support-chat/js/supportchat.js	Thu Apr 08 15:48:32 2010 +0100
+++ b/support-chat/js/supportchat.js	Thu Apr 08 16:41:23 2010 +0100
@@ -219,6 +219,10 @@
 	ui.appendTo("body");
 	
 	$("#support-question-submit").click(on_question_submit);
+	$("#support-input").keypress(function (event) {
+		if(event.keyCode == 13)
+			$("#support-send-button").click();
+	});
 	$("#support-offline-submit-button").click(function ()
 	{
 		$("#support-offline-form").hide();

mercurial