From 54e9d565130b67fcc849fe805e9acca6c0b8aecc Mon Sep 17 00:00:00 2001 From: "Michael V. DePalatis" Date: Fri, 12 Aug 2016 16:53:05 +0200 Subject: [PATCH] Clear input when submitting message --- demos/chat/static/chat.js | 5 +++-- demos/chat/templates/index.html | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/demos/chat/static/chat.js b/demos/chat/static/chat.js index 240b4aea6..151a5880b 100644 --- a/demos/chat/static/chat.js +++ b/demos/chat/static/chat.js @@ -25,6 +25,7 @@ $(document).ready(function() { newMessage($(this)); return false; } + return true; }); $("#message").select(); updater.poll(); @@ -56,13 +57,13 @@ jQuery.postJSON = function(url, args, callback) { success: function(response) { if (callback) callback(eval("(" + response + ")")); }, error: function(response) { - console.log("ERROR:", response) + console.log("ERROR:", response); }}); }; jQuery.fn.formToDict = function() { var fields = this.serializeArray(); - var json = {} + var json = {}; for (var i = 0; i < fields.length; i++) { json[fields[i].name] = fields[i].value; } diff --git a/demos/chat/templates/index.html b/demos/chat/templates/index.html index 2e5852dbf..58433b446 100644 --- a/demos/chat/templates/index.html +++ b/demos/chat/templates/index.html @@ -16,7 +16,7 @@
- +
-- 2.47.2