mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-07 22:45: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) {
|
||||
chat.canMessage(touid, function(err) {
|
||||
function loadAndCenter(chatModal) {
|
||||
chat.load(chatModal.attr('UUID'));
|
||||
chat.center(chatModal);
|
||||
}
|
||||
|
||||
if (err) {
|
||||
return app.alertError(err.message);
|
||||
}
|
||||
|
||||
if (!chat.modalExists(touid)) {
|
||||
chat.createModal(username, touid, loadAndCenter);
|
||||
} else {
|
||||
loadAndCenter(chat.getModal(touid));
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
var titleObj = {
|
||||
|
||||
@@ -244,6 +244,14 @@ define('chat', ['taskbar', 'string', 'sounds', 'forum/chats'], function(taskbar,
|
||||
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 + ']]');
|
||||
|
||||
taskbar.push('chat', chatModal.attr('UUID'), {
|
||||
|
||||
Reference in New Issue
Block a user