Wait for scroll before deciding whether to add scroll down button

FREEBIE
This commit is contained in:
Scott Nonnenberg 2017-05-19 14:45:40 -07:00
parent ae7044fd30
commit bb468e7b01

View file

@ -278,9 +278,13 @@
unreadEl.insertBefore(this.$('#' + oldestUnread.get('id')));
var position = unreadEl[0].scrollIntoView(true);
if (this.view.bottomOffset > 0) {
this.addScrollDownButtonWithCount(unreadCount);
}
// scrollIntoView is an async operation, but we have no way to listen for
// completion of the resultant scroll.
setTimeout(function() {
if (this.view.bottomOffset > 0) {
this.addScrollDownButtonWithCount(unreadCount);
}
}.bind(this), 1);
}
},