mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-15 18:26:15 +01:00
Revert
This commit is contained in:
@@ -35,7 +35,6 @@ define('forum/chats', [
|
|||||||
recentChats.init();
|
recentChats.init();
|
||||||
|
|
||||||
Chats.addEventListeners();
|
Chats.addEventListeners();
|
||||||
Chats.resizeMainWindow();
|
|
||||||
Chats.setActive();
|
Chats.setActive();
|
||||||
|
|
||||||
if (env === 'md' || env === 'lg') {
|
if (env === 'md' || env === 'lg') {
|
||||||
@@ -430,7 +429,6 @@ define('forum/chats', [
|
|||||||
app.parseAndTranslate('partials/chats/message-window', payload, function (html) {
|
app.parseAndTranslate('partials/chats/message-window', payload, function (html) {
|
||||||
components.get('chat/main-wrapper').html(html);
|
components.get('chat/main-wrapper').html(html);
|
||||||
html.find('.timeago').timeago();
|
html.find('.timeago').timeago();
|
||||||
Chats.resizeMainWindow();
|
|
||||||
ajaxify.data = payload;
|
ajaxify.data = payload;
|
||||||
Chats.setActive();
|
Chats.setActive();
|
||||||
Chats.addEventListeners();
|
Chats.addEventListeners();
|
||||||
@@ -456,7 +454,6 @@ define('forum/chats', [
|
|||||||
};
|
};
|
||||||
|
|
||||||
Chats.addGlobalEventListeners = function () {
|
Chats.addGlobalEventListeners = function () {
|
||||||
$(window).on('resize', utils.throttle(Chats.resizeMainWindow, 100));
|
|
||||||
$(window).on('mousemove keypress click', function () {
|
$(window).on('mousemove keypress click', function () {
|
||||||
if (newMessage && ajaxify.data.roomId) {
|
if (newMessage && ajaxify.data.roomId) {
|
||||||
socket.emit('modules.chats.markRead', ajaxify.data.roomId);
|
socket.emit('modules.chats.markRead', ajaxify.data.roomId);
|
||||||
@@ -508,18 +505,6 @@ define('forum/chats', [
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
Chats.resizeMainWindow = function () {
|
|
||||||
const viewportHeight = $(window).height();
|
|
||||||
const mainWrapper = components.get('chat/main-wrapper');
|
|
||||||
const navWrapper = components.get('chat/nav-wrapper');
|
|
||||||
let fromTop = 0;
|
|
||||||
if (mainWrapper.length && navWrapper.length) {
|
|
||||||
fromTop = mainWrapper.offset().top || navWrapper.offset().top;
|
|
||||||
}
|
|
||||||
|
|
||||||
$('.chats-full').height(viewportHeight - fromTop - 1);
|
|
||||||
};
|
|
||||||
|
|
||||||
Chats.setActive = function () {
|
Chats.setActive = function () {
|
||||||
if (ajaxify.data.roomId) {
|
if (ajaxify.data.roomId) {
|
||||||
socket.emit('modules.chats.markRead', ajaxify.data.roomId);
|
socket.emit('modules.chats.markRead', ajaxify.data.roomId);
|
||||||
|
|||||||
Reference in New Issue
Block a user