1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-07-24 11:38:30 +00:00

Fix chat scroll pausing. scrollToBottom was moved from the object prototype (aka the correct place for functions) to being defined in the constructor (aka not the correct place), making it more annoying to override.

This commit is contained in:
SirStendec 2018-01-15 20:40:54 -05:00
parent be9de6de25
commit 95d0002b56
3 changed files with 16 additions and 9 deletions

View file

@ -62,13 +62,7 @@ export default class Scroller extends Module {
});
this.ChatScroller.ready((cls, instances) => {
const t = this,
old_scroll = cls.prototype.scrollToBottom;
cls.prototype.scrollToBottom = function() {
if ( ! this.ffz_freeze_enabled || ! this.state.ffzFrozen )
return old_scroll.call(this);
}
const t = this;
cls.prototype.ffzShouldBeFrozen = function(since) {
if ( since === undefined )
@ -175,8 +169,14 @@ export default class Scroller extends Module {
if ( this._ffz_handleScroll )
return;
this._ffz_handleScroll = this.handleScrollEvent;
const t = this;
this._old_scroll = this.scrollToBottom;
this.scrollToBottom = function() {
if ( ! this.ffz_freeze_enabled || ! this.state.ffzFrozen )
return this._old_scroll();
}
this._ffz_handleScroll = this.handleScrollEvent;
this.handleScrollEvent = function(e) {
// If we're frozen because of FFZ, do not allow a mouse click to update
// the auto-scrolling state. That just gets annoying.