mirror of
https://github.com/the-djmaze/snappymail.git
synced 2025-01-05 22:42:25 +08:00
6170de5aee
https://snappymail.eu/demo/ updated for testing
31 lines
842 B
JavaScript
31 lines
842 B
JavaScript
import { Scope } from 'Common/Enums';
|
|
import { keyScope, leftPanelDisabled, SettingsGet, elementById } from 'Common/Globals';
|
|
import { addObservablesTo } from 'Common/Utils';
|
|
import { ThemeStore } from 'Stores/Theme';
|
|
|
|
export const AppUserStore = {
|
|
allowContacts: () => !!SettingsGet('ContactsIsAllowed')
|
|
};
|
|
|
|
addObservablesTo(AppUserStore, {
|
|
focusedState: Scope.None,
|
|
|
|
threadsAllowed: false,
|
|
|
|
composeInEdit: false
|
|
});
|
|
|
|
AppUserStore.focusedState.subscribe(value => {
|
|
switch (value) {
|
|
case Scope.MessageList:
|
|
case Scope.MessageView:
|
|
case Scope.FolderList:
|
|
keyScope(value);
|
|
ThemeStore.isMobile() && leftPanelDisabled(Scope.FolderList !== value);
|
|
break;
|
|
}
|
|
['FolderList','MessageList','MessageView'].forEach(name => {
|
|
let dom = elementById('V-Mail'+name);
|
|
dom && dom.classList.toggle('focused', name === value);
|
|
});
|
|
});
|