Revamp Mobile/Desktop switcher without completely reloading.

Remove switcher from login page, it became useless.
This commit is contained in:
djmaze 2021-02-16 20:12:23 +01:00
parent 292f3289ac
commit d7994ddab6
35 changed files with 159 additions and 202 deletions

View file

@ -1,5 +1,5 @@
import ko from 'ko';
import { isMobile } from 'Common/Globals';
import { $htmlCL } from 'Common/Globals';
export const ThemeStore = {
themes: ko.observableArray(),
@ -12,7 +12,7 @@ export const ThemeStore = {
this.themes(Array.isArray(themes) ? themes : []);
this.theme(Settings.get('Theme'));
if (!isMobile()) {
if (!this.isMobile()) {
this.themeBackgroundName(Settings.get('UserBackgroundName'));
this.themeBackgroundHash(Settings.get('UserBackgroundHash'));
}
@ -20,3 +20,6 @@ export const ThemeStore = {
};
ThemeStore.theme = ko.observable('').extend({ limitedList: ThemeStore.themes });
ThemeStore.isMobile = ko.observable($htmlCL.contains('rl-mobile'));
ThemeStore.isMobile.subscribe(value => $htmlCL.toggle('rl-mobile', value));