This commit is contained in:
Julian Lam
2014-10-30 17:50:07 -04:00
parent 28f87cc776
commit adfb89a2ad
8 changed files with 95 additions and 34 deletions

View File

@@ -314,16 +314,22 @@ var socket,
}
require(['chat'], function (chat) {
if (!chat.modalExists(touid)) {
chat.createModal(username, touid, loadAndCenter);
} else {
loadAndCenter(chat.getModal(touid));
}
chat.canMessage(touid, function(err) {
if (!err) {
if (!chat.modalExists(touid)) {
chat.createModal(username, touid, loadAndCenter);
} else {
loadAndCenter(chat.getModal(touid));
}
function loadAndCenter(chatModal) {
chat.load(chatModal.attr('UUID'));
chat.center(chatModal);
}
function loadAndCenter(chatModal) {
chat.load(chatModal.attr('UUID'));
chat.center(chatModal);
}
} else {
app.alertError(err.message);
}
});
});
};