From 607decd29775f87bbc6576671571f0bff5227a07 Mon Sep 17 00:00:00 2001 From: Rodrigo Souto Date: Mon, 3 Nov 2014 15:06:57 -0300 Subject: [PATCH] Add default value for offset --- public/javascripts/chat.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/javascripts/chat.js b/public/javascripts/chat.js index a2c7688..9a0ddc0 100644 --- a/public/javascripts/chat.js +++ b/public/javascripts/chat.js @@ -117,6 +117,7 @@ jQuery(function($) { }, show_message: function (jid, name, body, who, identifier, time, offset) { + if(!offset) offset = 0; if (body) { body = Jabber.render_body_message(body); var jid_id = Jabber.jid_to_id(jid); @@ -124,7 +125,7 @@ jQuery(function($) { var history = $(tab_id).find('.history'); var offset_container = $('#chat-offset-container-'+offset); - if(offset_container.length == 0) + if(offset_container.length == 0) offset_container = $('
').prependTo(history); if (offset_container.find('.message:last').attr('data-who') == who) { -- libgit2 0.21.2