mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-30 20:49:20 +03:00
Revamp Mobile/Desktop switcher without completely reloading.
Remove switcher from login page, it became useless.
This commit is contained in:
parent
292f3289ac
commit
d7994ddab6
35 changed files with 159 additions and 202 deletions
|
|
@ -2,7 +2,7 @@ import ko from 'ko';
|
|||
|
||||
import { Capa, KeyState } from 'Common/Enums';
|
||||
import { Focused } from 'Common/EnumsUser';
|
||||
import { leftPanelDisabled, moveAction, Settings, isMobile } from 'Common/Globals';
|
||||
import { leftPanelDisabled, moveAction, Settings } from 'Common/Globals';
|
||||
import { mailBox, settings } from 'Common/Links';
|
||||
import { setFolderHash } from 'Common/Cache';
|
||||
|
||||
|
|
@ -10,6 +10,7 @@ import AppStore from 'Stores/User/App';
|
|||
import SettingsStore from 'Stores/User/Settings';
|
||||
import FolderStore from 'Stores/User/Folder';
|
||||
import MessageStore from 'Stores/User/Message';
|
||||
import { ThemeStore } from 'Stores/Theme';
|
||||
|
||||
import { showScreenPopup } from 'Knoin/Knoin';
|
||||
import { AbstractViewLeft } from 'Knoin/AbstractViews';
|
||||
|
|
@ -56,7 +57,7 @@ export class FolderListMailBoxUserView extends AbstractViewLeft {
|
|||
eqs = (ev, s) => ev.target.closestWithin(s, dom),
|
||||
fSelectFolder = (el, event, starred) => {
|
||||
const isMove = moveAction();
|
||||
isMobile() && leftPanelDisabled(true);
|
||||
ThemeStore.isMobile() && leftPanelDisabled(true);
|
||||
|
||||
event.preventDefault();
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ import {
|
|||
|
||||
import { UNUSED_OPTION_VALUE } from 'Common/Consts';
|
||||
|
||||
import { doc, leftPanelDisabled, moveAction, Settings, isMobile } from 'Common/Globals';
|
||||
import { doc, leftPanelDisabled, moveAction, Settings } from 'Common/Globals';
|
||||
|
||||
import { computedPaginatorHelper } from 'Common/UtilsUser';
|
||||
import { File } from 'Common/File';
|
||||
|
|
@ -37,6 +37,7 @@ import QuotaStore from 'Stores/User/Quota';
|
|||
import SettingsStore from 'Stores/User/Settings';
|
||||
import FolderStore from 'Stores/User/Folder';
|
||||
import MessageStore from 'Stores/User/Message';
|
||||
import { ThemeStore } from 'Stores/Theme';
|
||||
|
||||
import Remote from 'Remote/User/Fetch';
|
||||
|
||||
|
|
@ -172,9 +173,9 @@ export class MessageListMailBoxUserView extends AbstractViewRight {
|
|||
isUnSpamVisible: () =>
|
||||
this.isSpamFolder() && !this.isSpamDisabled() && !this.isDraftFolder() && !this.isSentFolder(),
|
||||
|
||||
mobileCheckedStateShow: () => isMobile() ? 0 < MessageStore.messageListChecked().length : true,
|
||||
mobileCheckedStateShow: () => ThemeStore.isMobile() ? 0 < MessageStore.messageListChecked().length : true,
|
||||
|
||||
mobileCheckedStateHide: () => isMobile() ? !MessageStore.messageListChecked().length : true,
|
||||
mobileCheckedStateHide: () => ThemeStore.isMobile() ? !MessageStore.messageListChecked().length : true,
|
||||
|
||||
messageListFocused: () => Focused.MessageList === AppStore.focusedState()
|
||||
});
|
||||
|
|
@ -673,7 +674,7 @@ export class MessageListMailBoxUserView extends AbstractViewRight {
|
|||
this.selector.init(dom.querySelector('.b-content'), KeyState.MessageList);
|
||||
|
||||
dom.addEventListener('click', event => {
|
||||
isMobile() && leftPanelDisabled(true);
|
||||
ThemeStore.isMobile() && leftPanelDisabled(true);
|
||||
|
||||
if (eqs(event, '.messageList .b-message-list-wrapper') && Focused.MessageView === AppStore.focusedState()) {
|
||||
AppStore.focusedState(Focused.MessageList);
|
||||
|
|
@ -699,7 +700,7 @@ export class MessageListMailBoxUserView extends AbstractViewRight {
|
|||
this.initUploaderForAppend();
|
||||
this.initShortcuts();
|
||||
|
||||
if (!isMobile() && Settings.capa(Capa.Prefetch)) {
|
||||
if (!ThemeStore.isMobile() && Settings.capa(Capa.Prefetch)) {
|
||||
ifvisible.idle(this.prefetchNextTick.bind(this));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ import {
|
|||
MessageSetAction
|
||||
} from 'Common/EnumsUser';
|
||||
|
||||
import { $htmlCL, leftPanelDisabled, keyScopeReal, moveAction, Settings, isMobile } from 'Common/Globals';
|
||||
import { $htmlCL, leftPanelDisabled, keyScopeReal, moveAction, Settings } from 'Common/Globals';
|
||||
|
||||
import { inFocus } from 'Common/Utils';
|
||||
import { mailToHelper } from 'Common/UtilsUser';
|
||||
|
|
@ -32,6 +32,7 @@ import SettingsStore from 'Stores/User/Settings';
|
|||
import AccountStore from 'Stores/User/Account';
|
||||
import FolderStore from 'Stores/User/Folder';
|
||||
import MessageStore from 'Stores/User/Message';
|
||||
import { ThemeStore } from 'Stores/Theme';
|
||||
|
||||
import * as Local from 'Storage/Client';
|
||||
|
||||
|
|
@ -413,7 +414,7 @@ class MessageViewMailBoxUserView extends AbstractViewRight {
|
|||
|
||||
const eqs = (ev, s) => ev.target.closestWithin(s, dom);
|
||||
dom.addEventListener('click', event => {
|
||||
isMobile() && leftPanelDisabled(true);
|
||||
ThemeStore.isMobile() && leftPanelDisabled(true);
|
||||
|
||||
let el = eqs(event, 'a');
|
||||
if (el) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue