mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-03-04 11:31:23 +01:00
no longer using bringModalToTop, in favour of taskbar modal focused class
re: #6532
This commit is contained in:
@@ -142,24 +142,6 @@ define('chat', [
|
||||
});
|
||||
};
|
||||
|
||||
module.bringModalToTop = function (chatModal) {
|
||||
var topZ = 0;
|
||||
|
||||
taskbar.updateActive(chatModal.attr('data-uuid'));
|
||||
|
||||
if ($('.chat-modal').length === 1) {
|
||||
return;
|
||||
}
|
||||
$('.chat-modal').each(function () {
|
||||
var thisZ = parseInt($(this).css('zIndex'), 10);
|
||||
if (thisZ > topZ) {
|
||||
topZ = thisZ;
|
||||
}
|
||||
});
|
||||
|
||||
chatModal.css('zIndex', topZ + 1);
|
||||
};
|
||||
|
||||
module.getModal = function (roomId) {
|
||||
return $('#chat-modal-' + roomId);
|
||||
};
|
||||
@@ -199,7 +181,7 @@ define('chat', [
|
||||
|
||||
chatModal.draggable({
|
||||
start: function () {
|
||||
module.bringModalToTop(chatModal);
|
||||
taskbar.updateActive(uuid);
|
||||
},
|
||||
stop: function () {
|
||||
chatModal.find('#chat-message-input').focus();
|
||||
@@ -233,7 +215,7 @@ define('chat', [
|
||||
});
|
||||
|
||||
chatModal.on('click', function () {
|
||||
module.bringModalToTop(chatModal);
|
||||
taskbar.updateActive(this.getAttribute('data-uuid'));
|
||||
|
||||
if (dragged) {
|
||||
dragged = false;
|
||||
@@ -316,7 +298,6 @@ define('chat', [
|
||||
chatModal.removeClass('hide');
|
||||
taskbar.updateActive(uuid);
|
||||
ChatsMessages.scrollToBottom(chatModal.find('.chat-content'));
|
||||
module.bringModalToTop(chatModal);
|
||||
module.focusInput(chatModal);
|
||||
socket.emit('modules.chats.markRead', chatModal.attr('data-roomid'));
|
||||
|
||||
|
||||
@@ -86,6 +86,9 @@ define('taskbar', ['benchpress'], function (Benchpress) {
|
||||
var tasks = taskbar.tasklist.find('li');
|
||||
tasks.removeClass('active');
|
||||
tasks.filter('[data-uuid="' + uuid + '"]').addClass('active');
|
||||
|
||||
$('[data-uuid]:not([data-module])').toggleClass('modal-focused', false);
|
||||
$('[data-uuid="' + uuid + '"]:not([data-module])').toggleClass('modal-focused', true);
|
||||
};
|
||||
|
||||
taskbar.isActive = function (uuid) {
|
||||
|
||||
Reference in New Issue
Block a user