always scroll down when user sends a message
This commit is contained in:
parent
62f0aacf56
commit
032fe0d417
@ -329,8 +329,16 @@
|
|||||||
|
|
||||||
handleTextMessage: function (message) {
|
handleTextMessage: function (message) {
|
||||||
this.showMessage(_.clone(message.attributes));
|
this.showMessage(_.clone(message.attributes));
|
||||||
if ((message.get('sender') !== 'me') && (converse.windowState === 'blur') || this.model.get('scrolled', true)) {
|
if (message.get('sender') !== 'me') {
|
||||||
converse.incrementMsgCounter();
|
if (converse.windowState === 'blur' || this.model.get('scrolled', true)) {
|
||||||
|
converse.incrementMsgCounter();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// We remove the "scrolled" flag so that the chat area
|
||||||
|
// gets scrolled down. We always want to scroll down
|
||||||
|
// when the user writes a message as opposed to when a
|
||||||
|
// message is received.
|
||||||
|
this.model.set('scrolled', false);
|
||||||
}
|
}
|
||||||
if (this.shouldShowOnTextMessage()) {
|
if (this.shouldShowOnTextMessage()) {
|
||||||
this.show();
|
this.show();
|
||||||
|
Loading…
Reference in New Issue
Block a user