1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-07-25 20:18:31 +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

@ -1,3 +1,8 @@
<div class="list-header">4.0.0-beta1.5<span>@68369664d8835665997c</span> <time datetime="2018-01-15">(2018-01-15)</time></div>
<ul class="chat-menu-content menu-side-padding">
<li>Fixed: Chat Freeze breaking due to Twitch moving the <code>scrollToBottom</code> function out of the prototype and defining it on the chat pane during construction.</li>
</ul>
<div class="list-header">4.0.0-beta1.5<span>@9a60ce1ee6c58905c6eb</span> <time datetime="2017-12-13">(2017-12-13)</time></div> <div class="list-header">4.0.0-beta1.5<span>@9a60ce1ee6c58905c6eb</span> <time datetime="2017-12-13">(2017-12-13)</time></div>
<ul class="chat-menu-content menu-side-padding"> <ul class="chat-menu-content menu-side-padding">
<li>Fixed: Player not covering the whole window in theater mode with a custom chat width and chat collapsed.</li> <li>Fixed: Player not covering the whole window in theater mode with a custom chat width and chat collapsed.</li>

View file

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

View file

@ -4,8 +4,10 @@
.chat-line__moderation, .chat-line__moderation,
.chat-line__status, .chat-line__status,
.chat-line__raid, .chat-list__lines .chat-line__raid,
.chat-list__lines .chat-line__subscribe, .chat-list__lines .chat-line__subscribe,
.chat-list__lines .chat-line__bits-charity,
.chat-list__lines .chat-line__ritual,
.chat-line__subscribe, .chat-line__subscribe,
.chat-line__message { .chat-line__message {
background-color: transparent !important; background-color: transparent !important;