small tweak to chat height

v1.18.x
barisusakli 11 years ago
parent 6e66911ef7
commit 7a60d478f4

@ -30,12 +30,7 @@ define('forum/chats', ['string', 'sounds'], function(S, sounds) {
}; };
Chats.isCurrentChat = function(uid) { Chats.isCurrentChat = function(uid) {
uid = parseInt(uid, 10); return Chats.getRecipientUid() === parseInt(uid, 10);
if (Chats.getRecipientUid() === uid) {
return true;
} else {
return false;
}
}; };
Chats.addEventListeners = function() { Chats.addEventListeners = function() {
@ -134,16 +129,12 @@ define('forum/chats', ['string', 'sounds'], function(S, sounds) {
var messagesList = $('.expanded-chat ul'); var messagesList = $('.expanded-chat ul');
if (messagesList.length) { if (messagesList.length) {
var inputEl = $('.chat-input'), var margin = $('.expanded-chat ul').outerHeight(true) - $('.expanded-chat ul').height(),
viewportHeight = $(window).height(), inputHeight = $('.chat-input').outerHeight(true),
margin = $('.expanded-chat ul').outerHeight() - $('.expanded-chat ul').height(),
inputHeight = inputEl.outerHeight(),
fromTop = messagesList.offset().top; 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) { Chats.notifyTyping = function(toUid, typing) {

Loading…
Cancel
Save