mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-08 06:55:46 +01:00
fixed #2350 -- chat modal now opens, but input is disabled
This commit is contained in:
@@ -314,23 +314,17 @@ var socket,
|
|||||||
}
|
}
|
||||||
|
|
||||||
require(['chat'], function (chat) {
|
require(['chat'], function (chat) {
|
||||||
chat.canMessage(touid, function(err) {
|
|
||||||
function loadAndCenter(chatModal) {
|
function loadAndCenter(chatModal) {
|
||||||
chat.load(chatModal.attr('UUID'));
|
chat.load(chatModal.attr('UUID'));
|
||||||
chat.center(chatModal);
|
chat.center(chatModal);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (err) {
|
|
||||||
return app.alertError(err.message);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!chat.modalExists(touid)) {
|
if (!chat.modalExists(touid)) {
|
||||||
chat.createModal(username, touid, loadAndCenter);
|
chat.createModal(username, touid, loadAndCenter);
|
||||||
} else {
|
} else {
|
||||||
loadAndCenter(chat.getModal(touid));
|
loadAndCenter(chat.getModal(touid));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
var titleObj = {
|
var titleObj = {
|
||||||
|
|||||||
@@ -244,6 +244,14 @@ define('chat', ['taskbar', 'string', 'sounds', 'forum/chats'], function(taskbar,
|
|||||||
checkStatus(chatModal);
|
checkStatus(chatModal);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
module.canMessage(touid, function(err) {
|
||||||
|
if (err) {
|
||||||
|
// Disable the text input
|
||||||
|
chatModal.find('input[type="text"]').attr('disabled', true);
|
||||||
|
console.log('disabling');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
chatModal.find('.user-typing .text').translateText('[[modules:chat.user_typing, ' + username + ']]');
|
chatModal.find('.user-typing .text').translateText('[[modules:chat.user_typing, ' + username + ']]');
|
||||||
|
|
||||||
taskbar.push('chat', chatModal.attr('UUID'), {
|
taskbar.push('chat', chatModal.attr('UUID'), {
|
||||||
|
|||||||
Reference in New Issue
Block a user