1
0
mirror of https://github.com/chylex/TweetDuck.git synced 2025-05-11 20:34:07 +02:00

Fix notifications having outdated theme-related attributes on the <html> element

This commit is contained in:
chylex 2021-12-24 15:50:01 +01:00
parent 273e7266eb
commit ccb87351c1
Signed by: chylex
GPG Key ID: 4DE42C8F19A80548

View File

@ -6,11 +6,13 @@ import { getClassStyleProperty } from "./globals/get_class_style_property.js";
import { runAfterFunction } from "./globals/patch_functions.js";
function refreshSettings() {
const doc = document.documentElement;
const fontSizeName = TD.settings.getFontSize();
const themeName = TD.settings.getTheme();
const doc = document.documentElement;
doc.setAttribute("data-td-font", fontSizeName);
doc.setAttribute("data-td-theme", themeName);
// noinspection HtmlMissingClosingTag,HtmlRequiredLangAttribute,HtmlRequiredTitleElement
const tags = [
"<html " + Array.prototype.map.call(doc.attributes, ele => `${ele.name}="${ele.value}"`).join(" ") + "><head>"
@ -22,8 +24,6 @@ function refreshSettings() {
tags.push("<style>body { background: " + getClassStyleProperty("column-panel", "background-color") + " !important; }</style>");
doc.setAttribute("data-td-font", fontSizeName);
doc.setAttribute("data-td-theme", themeName);
$TD.loadNotificationLayout(fontSizeName, tags.join(""));
}