Small code cleanups and fix translations

This commit is contained in:
djmaze 2021-01-27 00:26:31 +01:00
parent b31bf3d7f5
commit 7ccc44616d
54 changed files with 288 additions and 426 deletions

View file

@ -14,7 +14,7 @@ import { showScreenPopup } from 'Knoin/Knoin';
import Remote from 'Remote/Admin/Fetch';
import ThemeStore from 'Stores/Theme';
import { ThemeStore } from 'Stores/Theme';
import LanguageStore from 'Stores/Language';
import AppAdminStore from 'Stores/Admin/App';
import CapaAdminStore from 'Stores/Admin/Capa';

View file

@ -4,8 +4,9 @@ import { SaveSettingsStep, UploadErrorCode, Capa } from 'Common/Enums';
import { changeTheme, convertThemeName } from 'Common/Utils';
import { userBackground, themePreviewLink, uploadBackground } from 'Common/Links';
import { i18n } from 'Common/Translator';
import { doc, $htmlCL } from 'Common/Globals';
import ThemeStore from 'Stores/Theme';
import { ThemeStore } from 'Stores/Theme';
import Remote from 'Remote/User/Fetch';
@ -39,13 +40,12 @@ export class ThemesUserSettings {
});
this.background.hash.subscribe((value) => {
const b = document.body, cl = document.documentElement.classList;
if (!value) {
cl.remove('UserBackground');
b.removeAttribute('style');
$htmlCL.remove('UserBackground');
doc.body.removeAttribute('style');
} else {
cl.add('UserBackground');
b.style.backgroundImage = "url("+userBackground(value)+")";
$htmlCL.add('UserBackground');
doc.body.style.backgroundImage = "url("+userBackground(value)+")";
}
});
}