mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-31 13:09:21 +03:00
Cleanup some enums to consts
This commit is contained in:
parent
91e60c1007
commit
da2ab68fcc
13 changed files with 103 additions and 126 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import { Scope } from 'Common/Enums';
|
||||
import { ScopeMessageList, ScopeMessageView } from 'Common/Enums';
|
||||
import { elementById } from 'Common/Globals';
|
||||
import { exitFullscreen } from 'Common/Fullscreen';
|
||||
import { addObservablesTo, addSubscribablesTo } from 'External/ko';
|
||||
|
|
@ -25,9 +25,9 @@ export const MessageUserStore = new class {
|
|||
clearTimeout(this.MessageSeenTimer);
|
||||
elementById('rl-right').classList.toggle('message-selected', !!message);
|
||||
if (message) {
|
||||
SettingsUserStore.usePreviewPane() || AppUserStore.focusedState(Scope.MessageView);
|
||||
SettingsUserStore.usePreviewPane() || AppUserStore.focusedState(ScopeMessageView);
|
||||
} else {
|
||||
AppUserStore.focusedState(Scope.MessageList);
|
||||
AppUserStore.focusedState(ScopeMessageList);
|
||||
exitFullscreen();
|
||||
}
|
||||
[...(this.bodiesDom()?.children || [])].forEach(el => el.hidden = true);
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import ko from 'ko';
|
||||
import { koComputable, addObservablesTo } from 'External/ko';
|
||||
|
||||
import { Layout } from 'Common/EnumsUser';
|
||||
import { LayoutSideView, LayoutBottomView } from 'Common/EnumsUser';
|
||||
import { pInt } from 'Common/Utils';
|
||||
import { $htmlCL, SettingsGet, fireEvent } from 'Common/Globals';
|
||||
import { ThemeStore } from 'Stores/Theme';
|
||||
|
|
@ -54,8 +54,8 @@ export const SettingsUserStore = new class {
|
|||
|
||||
const toggleLayout = () => {
|
||||
const value = self.usePreviewPane();
|
||||
$htmlCL.toggle('sm-msgView-side', Layout.SidePreview === value);
|
||||
$htmlCL.toggle('sm-msgView-bottom', Layout.BottomPreview === value);
|
||||
$htmlCL.toggle('sm-msgView-side', LayoutSideView === value);
|
||||
$htmlCL.toggle('sm-msgView-bottom', LayoutBottomView === value);
|
||||
fireEvent('rl-layout', value);
|
||||
};
|
||||
self.layout.subscribe(toggleLayout);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue