mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-08 23:15:48 +01:00
closed #2361
This commit is contained in:
@@ -121,6 +121,9 @@ define('chat', ['taskbar', 'string', 'sounds', 'forum/chats'], function(taskbar,
|
|||||||
|
|
||||||
module.bringModalToTop = function(chatModal) {
|
module.bringModalToTop = function(chatModal) {
|
||||||
var topZ = 0;
|
var topZ = 0;
|
||||||
|
|
||||||
|
taskbar.updateActive(chatModal.attr('UUID'));
|
||||||
|
|
||||||
if ($('.chat-modal').length === 1) {
|
if ($('.chat-modal').length === 1) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -132,7 +135,6 @@ define('chat', ['taskbar', 'string', 'sounds', 'forum/chats'], function(taskbar,
|
|||||||
});
|
});
|
||||||
|
|
||||||
chatModal.css('zIndex', topZ + 1);
|
chatModal.css('zIndex', topZ + 1);
|
||||||
taskbar.updateActive(chatModal.attr('UUID'));
|
|
||||||
};
|
};
|
||||||
|
|
||||||
module.getModal = function(touid) {
|
module.getModal = function(touid) {
|
||||||
@@ -166,7 +168,8 @@ define('chat', ['taskbar', 'string', 'sounds', 'forum/chats'], function(taskbar,
|
|||||||
translator.translate(chatTpl, function (chatTpl) {
|
translator.translate(chatTpl, function (chatTpl) {
|
||||||
|
|
||||||
var chatModal = $(chatTpl),
|
var chatModal = $(chatTpl),
|
||||||
uuid = utils.generateUUID();
|
uuid = utils.generateUUID(),
|
||||||
|
dragged = false;
|
||||||
|
|
||||||
chatModal.attr('id', 'chat-modal-' + touid);
|
chatModal.attr('id', 'chat-modal-' + touid);
|
||||||
chatModal.attr('touid', touid);
|
chatModal.attr('touid', touid);
|
||||||
@@ -221,6 +224,18 @@ define('chat', ['taskbar', 'string', 'sounds', 'forum/chats'], function(taskbar,
|
|||||||
|
|
||||||
chatModal.on('click', function(e) {
|
chatModal.on('click', function(e) {
|
||||||
module.bringModalToTop(chatModal);
|
module.bringModalToTop(chatModal);
|
||||||
|
|
||||||
|
if (!dragged) {
|
||||||
|
chatModal.find('#chat-message-input').focus();
|
||||||
|
} else {
|
||||||
|
dragged = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
chatModal.on('mousemove', function(e) {
|
||||||
|
if (e.which === 1) {
|
||||||
|
dragged = true;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
chatModal.on('mousemove keypress click', function() {
|
chatModal.on('mousemove keypress click', function() {
|
||||||
|
|||||||
Reference in New Issue
Block a user