mirror of
https://github.com/the-djmaze/snappymail.git
synced 2024-11-10 17:13:38 +08:00
24 lines
685 B
JavaScript
24 lines
685 B
JavaScript
import { keyScope, leftPanelDisabled, SettingsGet, elementById } from 'Common/Globals';
|
|
import { addObservablesTo } from 'External/ko';
|
|
import { ThemeStore } from 'Stores/Theme';
|
|
|
|
export const AppUserStore = {
|
|
allowContacts: () => !!SettingsGet('ContactsIsAllowed')
|
|
};
|
|
|
|
addObservablesTo(AppUserStore, {
|
|
focusedState: 'none',
|
|
|
|
threadsAllowed: false
|
|
});
|
|
|
|
AppUserStore.focusedState.subscribe(value => {
|
|
['FolderList','MessageList','MessageView'].forEach(name => {
|
|
if (name === value) {
|
|
keyScope(value);
|
|
ThemeStore.isMobile() && leftPanelDisabled('FolderList' !== value);
|
|
}
|
|
let dom = elementById('V-Mail'+name);
|
|
dom?.classList.toggle('focused', name === value);
|
|
});
|
|
});
|