Archived
1
0

focus on new threads in liveui

This commit is contained in:
Jeff Becker 2016-07-06 07:59:13 -04:00
parent b2c1d9eb26
commit 5875347966
No known key found for this signature in database
GPG Key ID: AB950234D6EA286B

View File

@ -857,6 +857,7 @@ function Chat(domElem, channel, options) {
var self = this; var self = this;
this.name = channel.toLowerCase(); this.name = channel.toLowerCase();
this.domElem = domElem; this.domElem = domElem;
this.lastOp = null;
if (options) { if (options) {
this.options = options; this.options = options;
} else { } else {
@ -1098,6 +1099,13 @@ Chat.prototype.handleMessage = function (data) {
// captcha challenge // captcha challenge
self.login(); self.login();
} }
} else if (mtype == "posted" ) {
// user posted something
if ( data.OP ) {
// they made a new thread, focus on it once it comes up
self.lastOp = data.Msgid
console.log("made new thread: "+data.Msgid)
}
} else if (mtype == "post" ) { } else if (mtype == "post" ) {
self.insertChat(self.generateChat(data), data); self.insertChat(self.generateChat(data), data);
} else if (mtype == "count" ) { } else if (mtype == "count" ) {
@ -1178,6 +1186,11 @@ Chat.prototype.insertChat = function(chat, data) {
// scroll to end // scroll to end
self.scroll(); self.scroll();
self.rollover(); self.rollover();
// show new thread
if (self.lastOp) {
self.chatElems.convobar.show(self.lastOp);
self.lastOp = null;
}
} }