1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-07-04 01:58:31 +00:00

Fixed potential future bug with BetterTTV and FFZ Dark Mode.

This commit is contained in:
SirStendec 2015-02-08 02:14:52 -05:00
parent b284bd0f8d
commit c568f23134
4 changed files with 22 additions and 2 deletions

View file

@ -1322,6 +1322,13 @@ FFZ.prototype.setup_bttv = function(delay) {
this.track('setCustomVariable', '3', 'BetterTTV', BetterTTV.info.versionString()); this.track('setCustomVariable', '3', 'BetterTTV', BetterTTV.info.versionString());
// Disable Dark if it's enabled.
document.querySelector(".app-main").classList.remove("ffz-dark");
if ( this._dark_style ) {
this._dark_style.parentElement.removeChild(this._dark_style);
delete this._dark_style;
}
// Send Message Behavior // Send Message Behavior
var original_send = BetterTTV.chat.helpers.sendMessage, f = this; var original_send = BetterTTV.chat.helpers.sendMessage, f = this;
BetterTTV.chat.helpers.sendMessage = function(message) { BetterTTV.chat.helpers.sendMessage = function(message) {

4
script.min.js vendored

File diff suppressed because one or more lines are too long

View file

@ -25,6 +25,13 @@ FFZ.prototype.setup_bttv = function(delay) {
this.track('setCustomVariable', '3', 'BetterTTV', BetterTTV.info.versionString()); this.track('setCustomVariable', '3', 'BetterTTV', BetterTTV.info.versionString());
// Disable Dark if it's enabled.
document.querySelector(".app-main").classList.remove("ffz-dark");
if ( this._dark_style ) {
this._dark_style.parentElement.removeChild(this._dark_style);
delete this._dark_style;
}
// Send Message Behavior // Send Message Behavior
var original_send = BetterTTV.chat.helpers.sendMessage, f = this; var original_send = BetterTTV.chat.helpers.sendMessage, f = this;
BetterTTV.chat.helpers.sendMessage = function(message) { BetterTTV.chat.helpers.sendMessage = function(message) {

View file

@ -16,6 +16,9 @@ FFZ.settings_info.dark_twitch = {
help: "View the entire site with a dark theme.", help: "View the entire site with a dark theme.",
on_update: function(val) { on_update: function(val) {
if ( this.has_bttv )
return;
document.querySelector(".app-main").classList.toggle("ffz-dark", val); document.querySelector(".app-main").classList.toggle("ffz-dark", val);
if ( val ) if ( val )
this._load_dark_css(); this._load_dark_css();
@ -28,6 +31,9 @@ FFZ.settings_info.dark_twitch = {
// --------------------- // ---------------------
FFZ.prototype.setup_dark = function() { FFZ.prototype.setup_dark = function() {
if ( this.has_bttv )
return;
document.querySelector(".app-main").classList.toggle("ffz-dark", this.settings.dark_twitch); document.querySelector(".app-main").classList.toggle("ffz-dark", this.settings.dark_twitch);
if ( this.settings.dark_twitch ) if ( this.settings.dark_twitch )
this._load_dark_css(); this._load_dark_css();