From 7a60d478f425b03cd95339f7292ec0204de5eafb Mon Sep 17 00:00:00 2001 From: barisusakli Date: Sat, 19 Jul 2014 18:02:35 -0400 Subject: [PATCH] small tweak to chat height --- public/src/forum/chats.js | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/public/src/forum/chats.js b/public/src/forum/chats.js index 92086a8b6d..d84dbac203 100644 --- a/public/src/forum/chats.js +++ b/public/src/forum/chats.js @@ -30,12 +30,7 @@ define('forum/chats', ['string', 'sounds'], function(S, sounds) { }; Chats.isCurrentChat = function(uid) { - uid = parseInt(uid, 10); - if (Chats.getRecipientUid() === uid) { - return true; - } else { - return false; - } + return Chats.getRecipientUid() === parseInt(uid, 10); }; Chats.addEventListeners = function() { @@ -134,16 +129,12 @@ define('forum/chats', ['string', 'sounds'], function(S, sounds) { var messagesList = $('.expanded-chat ul'); if (messagesList.length) { - var inputEl = $('.chat-input'), - viewportHeight = $(window).height(), - margin = $('.expanded-chat ul').outerHeight() - $('.expanded-chat ul').height(), - inputHeight = inputEl.outerHeight(), + var margin = $('.expanded-chat ul').outerHeight(true) - $('.expanded-chat ul').height(), + inputHeight = $('.chat-input').outerHeight(true), fromTop = messagesList.offset().top; - messagesList.height(viewportHeight-(fromTop+inputHeight+(margin*4))); + messagesList.height($(window).height() - (fromTop + inputHeight + (margin * 4))); } - - return; }; Chats.notifyTyping = function(toUid, typing) {