NorbiPeti
0055ac8f2b
- Added conversations to the sidebar and the ability to switch between them - Fixed loader and managed type methods - Changed unread message style
34 lines
972 B
JavaScript
34 lines
972 B
JavaScript
/**
|
|
* Created by Norbi on 2016-08-05.
|
|
*/
|
|
|
|
$(document).ready(function () {
|
|
conversationChanged();
|
|
});
|
|
|
|
function conversationChanged() {
|
|
var cmsgs = document.getElementById("channelmessages");
|
|
if (cmsgs != null && cmsgs.childElementCount > 0) {
|
|
var nodes = cmsgs.getElementsByClassName("chmessage");
|
|
for (var x = 0; x < nodes.length; x++) {
|
|
var item = nodes[x];
|
|
handlereceivedmessage(item);
|
|
}
|
|
}
|
|
if (document.getElementById("convidp").innerText == "-1") {
|
|
document.getElementById("msginput").style.display = "none";
|
|
stopPoll();
|
|
}
|
|
else {
|
|
document.getElementById("msginput").style.display = "block";
|
|
startPoll();
|
|
}
|
|
}
|
|
|
|
function changeConversation(convid) {
|
|
var convidp = document.getElementById("convidp");
|
|
if (convidp.innerText == convid + "")
|
|
return;
|
|
convidp.innerText = convid;
|
|
conversationChanged();
|
|
}
|