mirror of
https://github.com/the-djmaze/snappymail.git
synced 2024-11-15 20:24:51 +08:00
0b0747b8dc
Removed some jQuery references Added JavaScript Globals.$htmlCL for frequently used window.document.documentElement.classList
37 lines
1.1 KiB
JavaScript
37 lines
1.1 KiB
JavaScript
import ko from 'ko';
|
|
import { $htmlCL, bMobileDevice } from 'Common/Globals';
|
|
import * as Settings from 'Storage/Settings';
|
|
|
|
class AbstractAppStore {
|
|
constructor() {
|
|
this.allowLanguagesOnSettings = ko.observable(true);
|
|
this.allowLanguagesOnLogin = ko.observable(true);
|
|
this.newMoveToFolder = ko.observable(true);
|
|
|
|
this.interfaceAnimation = ko.observable(true);
|
|
|
|
this.interfaceAnimation.subscribe((value) => {
|
|
const anim = bMobileDevice || !value;
|
|
$htmlCL.toggle('rl-anim', !anim);
|
|
$htmlCL.toggle('no-rl-anim', anim);
|
|
});
|
|
|
|
this.interfaceAnimation.valueHasMutated();
|
|
|
|
this.prem = ko.observable(false);
|
|
this.community = ko.observable(true);
|
|
}
|
|
|
|
populate() {
|
|
this.allowLanguagesOnLogin(!!Settings.settingsGet('AllowLanguagesOnLogin'));
|
|
this.allowLanguagesOnSettings(!!Settings.settingsGet('AllowLanguagesOnSettings'));
|
|
this.newMoveToFolder(!!Settings.settingsGet('NewMoveToFolder'));
|
|
|
|
this.interfaceAnimation(!!Settings.settingsGet('InterfaceAnimation'));
|
|
|
|
this.prem(!!Settings.settingsGet('PremType'));
|
|
this.community(!!Settings.settingsGet('Community'));
|
|
}
|
|
}
|
|
|
|
export { AbstractAppStore, AbstractAppStore as default };
|