mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-01 05:29:20 +03:00
Some tiny changes
This commit is contained in:
parent
219589b8ea
commit
c76823dc5f
8 changed files with 53 additions and 60 deletions
|
|
@ -6,7 +6,7 @@ import { mailToHelper, setLayoutResizer, dropdownsDetectVisibility } from 'Commo
|
|||
import {
|
||||
FolderType,
|
||||
SetSystemFoldersNotification,
|
||||
ClientSideKeyName
|
||||
ClientSideKeyNameFolderListSize
|
||||
} from 'Common/EnumsUser';
|
||||
|
||||
import {
|
||||
|
|
@ -335,7 +335,7 @@ class AppUser extends AbstractApp {
|
|||
const left = elementById('rl-left'),
|
||||
right = elementById('rl-right'),
|
||||
fToggle = () =>
|
||||
setLayoutResizer(left, right, ClientSideKeyName.FolderListSize,
|
||||
setLayoutResizer(left, right, ClientSideKeyNameFolderListSize,
|
||||
(ThemeStore.isMobile() || leftPanelDisabled()) ? 0 : 'Width');
|
||||
if (left && right) {
|
||||
fToggle();
|
||||
|
|
|
|||
|
|
@ -72,15 +72,14 @@ export const SetSystemFoldersNotification = {
|
|||
/**
|
||||
* @enum {number}
|
||||
*/
|
||||
export const ClientSideKeyName = {
|
||||
ExpandedFolders: 3,
|
||||
FolderListSize: 4,
|
||||
MessageListSize: 5,
|
||||
LastReplyAction: 6,
|
||||
LastSignMe: 7,
|
||||
MessageHeaderFullInfo: 9,
|
||||
MessageAttachmentControls: 10
|
||||
};
|
||||
export const
|
||||
ClientSideKeyNameExpandedFolders = 3,
|
||||
ClientSideKeyNameFolderListSize = 4,
|
||||
ClientSideKeyNameMessageListSize = 5,
|
||||
ClientSideKeyNameLastReplyAction = 6,
|
||||
ClientSideKeyNameLastSignMe = 7,
|
||||
ClientSideKeyNameMessageHeaderFullInfo = 9,
|
||||
ClientSideKeyNameMessageAttachmentControls = 10;
|
||||
|
||||
/**
|
||||
* @enum {number}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import { AbstractCollectionModel } from 'Model/AbstractCollection';
|
|||
|
||||
import { UNUSED_OPTION_VALUE } from 'Common/Consts';
|
||||
import { isArray, getKeyByValue, forEachObjectEntry, b64EncodeJSONSafe } from 'Common/Utils';
|
||||
import { ClientSideKeyName, FolderType, FolderMetadataKeys } from 'Common/EnumsUser';
|
||||
import { ClientSideKeyNameExpandedFolders, FolderType, FolderMetadataKeys } from 'Common/EnumsUser';
|
||||
import { getFolderFromCacheList, setFolder, setFolderInboxName, setFolderHash } from 'Common/Cache';
|
||||
import { Settings, SettingsGet, fireEvent } from 'Common/Globals';
|
||||
|
||||
|
|
@ -77,7 +77,7 @@ export const
|
|||
* @param {boolean} bExpanded
|
||||
*/
|
||||
setExpandedFolder = (sFullName, bExpanded) => {
|
||||
let aExpandedList = Local.get(ClientSideKeyName.ExpandedFolders);
|
||||
let aExpandedList = Local.get(ClientSideKeyNameExpandedFolders);
|
||||
if (!isArray(aExpandedList)) {
|
||||
aExpandedList = [];
|
||||
}
|
||||
|
|
@ -88,7 +88,7 @@ export const
|
|||
aExpandedList = aExpandedList.filter(value => value !== sFullName);
|
||||
}
|
||||
|
||||
Local.set(ClientSideKeyName.ExpandedFolders, aExpandedList);
|
||||
Local.set(ClientSideKeyNameExpandedFolders, aExpandedList);
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
@ -127,7 +127,7 @@ export class FolderCollectionModel extends AbstractCollectionModel
|
|||
* @returns {FolderCollectionModel}
|
||||
*/
|
||||
static reviveFromJson(object) {
|
||||
const expandedFolders = Local.get(ClientSideKeyName.ExpandedFolders);
|
||||
const expandedFolders = Local.get(ClientSideKeyNameExpandedFolders);
|
||||
if (object && object.SystemFolders) {
|
||||
forEachObjectEntry(SystemFolders, key =>
|
||||
SystemFolders[key] = SettingsGet(key+'Folder') || object.SystemFolders[FolderType[key]]
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { Scope } from 'Common/Enums';
|
||||
import { Layout, ClientSideKeyName } from 'Common/EnumsUser';
|
||||
import { Layout, ClientSideKeyNameMessageListSize } from 'Common/EnumsUser';
|
||||
import { doc, leftPanelDisabled, moveAction, Settings, elementById } from 'Common/Globals';
|
||||
import { pString, pInt } from 'Common/Utils';
|
||||
import { setLayoutResizer } from 'Common/UtilsUser';
|
||||
|
|
@ -106,7 +106,7 @@ export class MailBoxUserScreen extends AbstractScreen {
|
|||
bottom = elementById('V-MailMessageView'),
|
||||
fToggle = () => {
|
||||
let layout = SettingsUserStore.layout();
|
||||
setLayoutResizer(top, bottom, ClientSideKeyName.MessageListSize,
|
||||
setLayoutResizer(top, bottom, ClientSideKeyNameMessageListSize,
|
||||
(ThemeStore.isMobile() || Layout.NoPreview === layout)
|
||||
? 0
|
||||
: (Layout.SidePreview === layout ? 'Width' : 'Height')
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { Notification } from 'Common/Enums';
|
||||
import { ClientSideKeyName } from 'Common/EnumsUser';
|
||||
import { ClientSideKeyNameLastSignMe } from 'Common/EnumsUser';
|
||||
import { SettingsGet, fireEvent } from 'Common/Globals';
|
||||
import { getNotification, translatorReload, convertLangName } from 'Common/Translator';
|
||||
|
||||
|
|
@ -14,7 +14,8 @@ import { AbstractViewLogin } from 'Knoin/AbstractViews';
|
|||
|
||||
import { LanguagesPopupView } from 'View/Popup/Languages';
|
||||
|
||||
const SignMeOff = 0,
|
||||
const
|
||||
SignMeOff = 0,
|
||||
SignMeOn = 1,
|
||||
SignMeUnused = 2;
|
||||
|
||||
|
|
@ -120,7 +121,7 @@ export class LoginUserView extends AbstractViewLogin {
|
|||
data
|
||||
);
|
||||
|
||||
Local.set(ClientSideKeyName.LastSignMe, this.signMe() ? '-1-' : '-0-');
|
||||
Local.set(ClientSideKeyNameLastSignMe, this.signMe() ? '-1-' : '-0-');
|
||||
}
|
||||
|
||||
return valid;
|
||||
|
|
@ -129,8 +130,7 @@ export class LoginUserView extends AbstractViewLogin {
|
|||
onBuild(dom) {
|
||||
super.onBuild(dom);
|
||||
|
||||
const signMeLocal = Local.get(ClientSideKeyName.LastSignMe),
|
||||
signMe = (SettingsGet('SignMe') || '').toLowerCase();
|
||||
const signMe = (SettingsGet('SignMe') || '').toLowerCase();
|
||||
|
||||
switch (signMe) {
|
||||
case 'defaultoff':
|
||||
|
|
@ -139,7 +139,7 @@ export class LoginUserView extends AbstractViewLogin {
|
|||
'defaulton' === signMe ? SignMeOn : SignMeOff
|
||||
);
|
||||
|
||||
switch (signMeLocal) {
|
||||
switch (Local.get(ClientSideKeyNameLastSignMe)) {
|
||||
case '-1-':
|
||||
this.signMeType(SignMeOn);
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -7,7 +7,9 @@ import { Scope } from 'Common/Enums';
|
|||
|
||||
import {
|
||||
ComposeType,
|
||||
ClientSideKeyName,
|
||||
ClientSideKeyNameLastReplyAction,
|
||||
ClientSideKeyNameMessageHeaderFullInfo,
|
||||
ClientSideKeyNameMessageAttachmentControls,
|
||||
FolderType,
|
||||
MessageSetAction
|
||||
} from 'Common/EnumsUser';
|
||||
|
|
@ -96,7 +98,7 @@ export class MailMessageView extends AbstractViewRight {
|
|||
showAttachmentControls: false,
|
||||
downloadAsZipLoading: false,
|
||||
lastReplyAction_: '',
|
||||
showFullInfo: '1' === Local.get(ClientSideKeyName.MessageHeaderFullInfo),
|
||||
showFullInfo: '1' === Local.get(ClientSideKeyNameMessageHeaderFullInfo),
|
||||
moreDropdownTrigger: false,
|
||||
|
||||
// viewer
|
||||
|
|
@ -124,7 +126,7 @@ export class MailMessageView extends AbstractViewRight {
|
|||
this.messageListOfThreadsLoading = ko.observable(false).extend({ rateLimit: 1 });
|
||||
this.highlightUnselectedAttachments = ko.observable(false).extend({ falseTimeout: 2000 });
|
||||
|
||||
this.showAttachmentControlsState = v => Local.set(ClientSideKeyName.MessageAttachmentControls, !!v);
|
||||
this.showAttachmentControlsState = v => Local.set(ClientSideKeyNameMessageAttachmentControls, !!v);
|
||||
|
||||
this.downloadAsZipError = ko.observable(false).extend({ falseTimeout: 7000 });
|
||||
|
||||
|
|
@ -183,14 +185,14 @@ export class MailMessageView extends AbstractViewRight {
|
|||
showAttachmentControls: v => currentMessage()
|
||||
&& currentMessage().attachments.forEach(item => item && item.checked(!!v)),
|
||||
|
||||
lastReplyAction_: value => Local.set(ClientSideKeyName.LastReplyAction, value),
|
||||
lastReplyAction_: value => Local.set(ClientSideKeyNameLastReplyAction, value),
|
||||
|
||||
message: message => {
|
||||
MessageUserStore.activeDom(null);
|
||||
|
||||
if (message) {
|
||||
this.showAttachmentControls(false);
|
||||
if (Local.get(ClientSideKeyName.MessageAttachmentControls)) {
|
||||
if (Local.get(ClientSideKeyNameMessageAttachmentControls)) {
|
||||
setTimeout(() => {
|
||||
this.showAttachmentControls(true);
|
||||
}, 50);
|
||||
|
|
@ -222,10 +224,10 @@ export class MailMessageView extends AbstractViewRight {
|
|||
}
|
||||
},
|
||||
|
||||
showFullInfo: value => Local.set(ClientSideKeyName.MessageHeaderFullInfo, value ? '1' : '0')
|
||||
showFullInfo: value => Local.set(ClientSideKeyNameMessageHeaderFullInfo, value ? '1' : '0')
|
||||
});
|
||||
|
||||
this.lastReplyAction(Local.get(ClientSideKeyName.LastReplyAction) || ComposeType.Reply);
|
||||
this.lastReplyAction(Local.get(ClientSideKeyNameLastReplyAction) || ComposeType.Reply);
|
||||
|
||||
// commands
|
||||
this.replyCommand = createCommandReplyHelper(ComposeType.Reply);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue