|
|
@ -80,7 +80,7 @@ define('chat', ['components', 'taskbar', 'string', 'sounds', 'forum/chats', 'tra
|
|
|
|
|
|
|
|
|
|
|
|
if (modal.is(":visible")) {
|
|
|
|
if (modal.is(":visible")) {
|
|
|
|
taskbar.updateActive(modal.attr('UUID'));
|
|
|
|
taskbar.updateActive(modal.attr('UUID'));
|
|
|
|
Chats.scrollToBottom(modal.find('#chat-content'));
|
|
|
|
Chats.scrollToBottom(modal.find('.chat-content'));
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
module.toggleNew(modal.attr('UUID'), true, true);
|
|
|
|
module.toggleNew(modal.attr('UUID'), true, true);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -111,7 +111,7 @@ define('chat', ['components', 'taskbar', 'string', 'sounds', 'forum/chats', 'tra
|
|
|
|
|
|
|
|
|
|
|
|
socket.on('event:chats.userStartTyping', function(withUid) {
|
|
|
|
socket.on('event:chats.userStartTyping', function(withUid) {
|
|
|
|
var modal = module.getModal(withUid);
|
|
|
|
var modal = module.getModal(withUid);
|
|
|
|
var chatContent = modal.find('#chat-content');
|
|
|
|
var chatContent = modal.find('.chat-content');
|
|
|
|
if (!chatContent.length) {
|
|
|
|
if (!chatContent.length) {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -234,7 +234,7 @@ define('chat', ['components', 'taskbar', 'string', 'sounds', 'forum/chats', 'tra
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
chatModal.find('#chat-content').css('height', module.calculateChatListHeight(chatModal));
|
|
|
|
chatModal.find('.chat-content').css('height', module.calculateChatListHeight(chatModal));
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
chatModal.draggable({
|
|
|
|
chatModal.draggable({
|
|
|
@ -373,7 +373,7 @@ define('chat', ['components', 'taskbar', 'string', 'sounds', 'forum/chats', 'tra
|
|
|
|
chatModal.removeClass('hide');
|
|
|
|
chatModal.removeClass('hide');
|
|
|
|
checkStatus(chatModal);
|
|
|
|
checkStatus(chatModal);
|
|
|
|
taskbar.updateActive(uuid);
|
|
|
|
taskbar.updateActive(uuid);
|
|
|
|
Chats.scrollToBottom(chatModal.find('#chat-content'));
|
|
|
|
Chats.scrollToBottom(chatModal.find('.chat-content'));
|
|
|
|
module.bringModalToTop(chatModal);
|
|
|
|
module.bringModalToTop(chatModal);
|
|
|
|
module.focusInput(chatModal);
|
|
|
|
module.focusInput(chatModal);
|
|
|
|
socket.emit('modules.chats.markRead', chatModal.attr('touid'));
|
|
|
|
socket.emit('modules.chats.markRead', chatModal.attr('touid'));
|
|
|
@ -387,7 +387,7 @@ define('chat', ['components', 'taskbar', 'string', 'sounds', 'forum/chats', 'tra
|
|
|
|
module.enableMobileBehaviour = function(modalEl) {
|
|
|
|
module.enableMobileBehaviour = function(modalEl) {
|
|
|
|
app.toggleNavbar(false);
|
|
|
|
app.toggleNavbar(false);
|
|
|
|
modalEl.attr('data-mobile', '1');
|
|
|
|
modalEl.attr('data-mobile', '1');
|
|
|
|
var messagesEl = modalEl.find('#chat-content');
|
|
|
|
var messagesEl = modalEl.find('.chat-content');
|
|
|
|
messagesEl.css('height', module.calculateChatListHeight(modalEl));
|
|
|
|
messagesEl.css('height', module.calculateChatListHeight(modalEl));
|
|
|
|
|
|
|
|
|
|
|
|
$(window).on('resize', function() {
|
|
|
|
$(window).on('resize', function() {
|
|
|
@ -402,7 +402,7 @@ define('chat', ['components', 'taskbar', 'string', 'sounds', 'forum/chats', 'tra
|
|
|
|
module.calculateChatListHeight = function(modalEl) {
|
|
|
|
module.calculateChatListHeight = function(modalEl) {
|
|
|
|
var totalHeight = modalEl.find('.modal-content').outerHeight() - modalEl.find('.modal-header').outerHeight(),
|
|
|
|
var totalHeight = modalEl.find('.modal-content').outerHeight() - modalEl.find('.modal-header').outerHeight(),
|
|
|
|
padding = parseInt(modalEl.find('.modal-body').css('padding-top'), 10) + parseInt(modalEl.find('.modal-body').css('padding-bottom'), 10),
|
|
|
|
padding = parseInt(modalEl.find('.modal-body').css('padding-top'), 10) + parseInt(modalEl.find('.modal-body').css('padding-bottom'), 10),
|
|
|
|
contentMargin = parseInt(modalEl.find('#chat-content').css('margin-top'), 10) + parseInt(modalEl.find('#chat-content').css('margin-bottom'), 10),
|
|
|
|
contentMargin = parseInt(modalEl.find('.chat-content').css('margin-top'), 10) + parseInt(modalEl.find('.chat-content').css('margin-bottom'), 10),
|
|
|
|
sinceHeight = modalEl.find('.since-bar').outerHeight(true),
|
|
|
|
sinceHeight = modalEl.find('.since-bar').outerHeight(true),
|
|
|
|
inputGroupHeight = modalEl.find('.input-group').outerHeight();
|
|
|
|
inputGroupHeight = modalEl.find('.input-group').outerHeight();
|
|
|
|
|
|
|
|
|
|
|
@ -426,7 +426,7 @@ define('chat', ['components', 'taskbar', 'string', 'sounds', 'forum/chats', 'tra
|
|
|
|
|
|
|
|
|
|
|
|
function loadChatSince(chatModal, since, callback) {
|
|
|
|
function loadChatSince(chatModal, since, callback) {
|
|
|
|
socket.emit('modules.chats.get', {touid: chatModal.attr('touid'), since: since}, function(err, messages) {
|
|
|
|
socket.emit('modules.chats.get', {touid: chatModal.attr('touid'), since: since}, function(err, messages) {
|
|
|
|
var chatContent = chatModal.find('#chat-content');
|
|
|
|
var chatContent = chatModal.find('.chat-content');
|
|
|
|
chatContent.find('.chat-message').remove();
|
|
|
|
chatContent.find('.chat-message').remove();
|
|
|
|
module.appendChatMessage(chatModal, messages, callback);
|
|
|
|
module.appendChatMessage(chatModal, messages, callback);
|
|
|
|
});
|
|
|
|
});
|
|
|
@ -457,7 +457,7 @@ define('chat', ['components', 'taskbar', 'string', 'sounds', 'forum/chats', 'tra
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
module.appendChatMessage = function(chatModal, data, done) {
|
|
|
|
module.appendChatMessage = function(chatModal, data, done) {
|
|
|
|
var chatContent = chatModal.find('#chat-content');
|
|
|
|
var chatContent = chatModal.find('.chat-content');
|
|
|
|
|
|
|
|
|
|
|
|
Chats.parseMessage(data, function(html) {
|
|
|
|
Chats.parseMessage(data, function(html) {
|
|
|
|
var message = $(html);
|
|
|
|
var message = $(html);
|
|
|
|