mirror of
https://github.com/the-djmaze/snappymail.git
synced 2024-12-28 18:41:34 +08:00
24 lines
735 B
JavaScript
24 lines
735 B
JavaScript
import { keyScope, leftPanelDisabled, SettingsGet, elementById } from 'Common/Globals';
|
|
import { addObservablesTo } from 'External/ko';
|
|
import { ThemeStore } from 'Stores/Theme';
|
|
import { arePopupsVisible } from 'Knoin/Knoin';
|
|
|
|
export const AppUserStore = {
|
|
allowContacts: () => !!SettingsGet('contactsAllowed')
|
|
};
|
|
|
|
addObservablesTo(AppUserStore, {
|
|
focusedState: 'none',
|
|
|
|
threadsAllowed: false
|
|
});
|
|
|
|
AppUserStore.focusedState.subscribe(value => {
|
|
['FolderList','MessageList','MessageView'].forEach(name => {
|
|
if (name === value) {
|
|
arePopupsVisible() || keyScope(value);
|
|
ThemeStore.isMobile() && leftPanelDisabled('FolderList' !== value);
|
|
}
|
|
elementById('V-Mail'+name).classList.toggle('focused', name === value);
|
|
});
|
|
});
|