focus on new threads in liveui
This commit is contained in:
parent
b2c1d9eb26
commit
5875347966
@ -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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user