From fdb5d4845abdccae04b3f824eba8c3f1ef8a1216 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Blot=20=28=40U-Exp=29?= Date: Fri, 26 Sep 2014 20:04:29 +0200 Subject: [PATCH] Only modify dom and scroll if there any new message --- js/script.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/js/script.js b/js/script.js index 172320a..a6a3c71 100644 --- a/js/script.js +++ b/js/script.js @@ -33,8 +33,10 @@ var refreshConversation = function() { }, function(jsondata, status) { conversationBuf = formatConversation(jsondata); - $('.msg-endtag').before(conversationBuf); - $('#app-content').scrollTop(1E10); + if (conversationBuf != '') { + $('.msg-endtag').before(conversationBuf); + $('#app-content').scrollTop(1E10); + } } ); };