mirror of
https://github.com/smogon/pokemon-showdown-client.git
synced 2026-10-01 23:32:02 -05:00
!data no longer breaks battle chat scrolling
This commit is contained in:
@@ -851,12 +851,13 @@ function Battle(frame, logFrame, noPreload) {
|
||||
if (window.console && console.log) console.log(text);
|
||||
};
|
||||
this.log = function (html, preempt) {
|
||||
var willScroll = (self.logFrameElem.scrollTop() + 60 >= self.logElem.height() + self.logPreemptElem.height() - self.logFrameElem.height());
|
||||
if (preempt) {
|
||||
self.logPreemptElem.append(html);
|
||||
} else {
|
||||
self.logElem.append(html);
|
||||
}
|
||||
if (self.logFrameElem.scrollTop() + 60 >= self.logElem.height() + self.logPreemptElem.height() - self.logFrameElem.height()) {
|
||||
if (willScroll) {
|
||||
self.logFrameElem.scrollTop(self.logElem.height() + self.logPreemptElem.height());
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user