Changed font changing code to use jquery to fix Safari weirdness
Этот коммит содержится в:
@@ -695,15 +695,19 @@ export function applyTheme(theme) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function applyFont(fontName) {
|
export function applyFont(fontName) {
|
||||||
const body = document.querySelector('body');
|
const body = $('body');
|
||||||
const keys = Object.getOwnPropertyNames(body.classList);
|
|
||||||
keys.forEach((k) => {
|
for (const key of Reflect.ownKeys(Constants.FONTS)) {
|
||||||
const className = body.classList[k];
|
const className = Constants.FONTS[key];
|
||||||
if (className && className.lastIndexOf('font') === 0) {
|
|
||||||
body.classList.remove(className);
|
if (fontName === key) {
|
||||||
|
if (!body.hasClass(className)) {
|
||||||
|
body.addClass(className);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
body.removeClass(className);
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
body.classList.add(Constants.FONTS[fontName]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export function changeCss(className, classValue, classRepeat) {
|
export function changeCss(className, classValue, classRepeat) {
|
||||||
@@ -1238,4 +1242,4 @@ export function getPostTerm(post) {
|
|||||||
|
|
||||||
export function isFeatureEnabled(feature) {
|
export function isFeatureEnabled(feature) {
|
||||||
return PreferenceStore.getPreference(Constants.Preferences.CATEGORY_ADVANCED_SETTINGS, Constants.FeatureTogglePrefix + feature.label, {value: 'false'}).value === 'true';
|
return PreferenceStore.getPreference(Constants.Preferences.CATEGORY_ADVANCED_SETTINGS, Constants.FeatureTogglePrefix + feature.label, {value: 'false'}).value === 'true';
|
||||||
}
|
}
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user