mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
Cleanup folder handling a bit
This commit is contained in:
parent
421efc62ad
commit
18dc2889ce
6 changed files with 10 additions and 20 deletions
|
|
@ -1,5 +1,4 @@
|
||||||
import ko from 'ko';
|
import ko from 'ko';
|
||||||
import { koComputable } from 'External/ko';
|
|
||||||
|
|
||||||
import { Notification } from 'Common/Enums';
|
import { Notification } from 'Common/Enums';
|
||||||
import { FolderMetadataKeys } from 'Common/EnumsUser';
|
import { FolderMetadataKeys } from 'Common/EnumsUser';
|
||||||
|
|
@ -48,14 +47,7 @@ export class UserSettingsFolders /*extends AbstractViewSettings*/ {
|
||||||
this.folderListError = FolderUserStore.folderListError;
|
this.folderListError = FolderUserStore.folderListError;
|
||||||
this.hideUnsubscribed = SettingsUserStore.hideUnsubscribed;
|
this.hideUnsubscribed = SettingsUserStore.hideUnsubscribed;
|
||||||
|
|
||||||
this.loading = koComputable(() => {
|
this.loading = FolderUserStore.foldersChanging;
|
||||||
const loading = FolderUserStore.foldersLoading(),
|
|
||||||
creating = FolderUserStore.foldersCreating(),
|
|
||||||
deleting = FolderUserStore.foldersDeleting(),
|
|
||||||
renaming = FolderUserStore.foldersRenaming();
|
|
||||||
|
|
||||||
return loading || creating || deleting || renaming;
|
|
||||||
});
|
|
||||||
|
|
||||||
this.folderForDeletion = folderForDeletion;
|
this.folderForDeletion = folderForDeletion;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,7 @@ export const FolderUserStore = new class {
|
||||||
foldersChanging: () =>
|
foldersChanging: () =>
|
||||||
self.foldersLoading() | self.foldersCreating() | self.foldersDeleting() | self.foldersRenaming(),
|
self.foldersLoading() | self.foldersCreating() | self.foldersDeleting() | self.foldersRenaming(),
|
||||||
|
|
||||||
folderListSystemNames: () => {
|
systemFoldersNames: () => {
|
||||||
const list = [getFolderInboxName()],
|
const list = [getFolderInboxName()],
|
||||||
others = [self.sentFolder(), self.draftsFolder(), self.spamFolder(), self.trashFolder(), self.archiveFolder()];
|
others = [self.sentFolder(), self.draftsFolder(), self.spamFolder(), self.trashFolder(), self.archiveFolder()];
|
||||||
|
|
||||||
|
|
@ -74,8 +74,8 @@ export const FolderUserStore = new class {
|
||||||
return list;
|
return list;
|
||||||
},
|
},
|
||||||
|
|
||||||
folderListSystem: () =>
|
systemFolders: () =>
|
||||||
self.folderListSystemNames().map(name => getFolderFromCacheList(name)).filter(v => v)
|
self.systemFoldersNames().map(name => getFolderFromCacheList(name)).filter(v => v)
|
||||||
});
|
});
|
||||||
|
|
||||||
const
|
const
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ export class FolderSystemPopupView extends AbstractViewPopup {
|
||||||
|
|
||||||
this.folderSelectList = koComputable(() =>
|
this.folderSelectList = koComputable(() =>
|
||||||
folderListOptionsBuilder(
|
folderListOptionsBuilder(
|
||||||
FolderUserStore.folderListSystemNames(),
|
FolderUserStore.systemFoldersNames(),
|
||||||
[
|
[
|
||||||
['', i18n('POPUPS_SYSTEM_FOLDERS/SELECT_CHOOSE_ONE')],
|
['', i18n('POPUPS_SYSTEM_FOLDERS/SELECT_CHOOSE_ONE')],
|
||||||
[UNUSED_OPTION_VALUE, i18n('POPUPS_SYSTEM_FOLDERS/SELECT_UNUSE_NAME')]
|
[UNUSED_OPTION_VALUE, i18n('POPUPS_SYSTEM_FOLDERS/SELECT_UNUSE_NAME')]
|
||||||
|
|
|
||||||
|
|
@ -31,9 +31,7 @@ export class MailFolderList extends AbstractViewLeft {
|
||||||
|
|
||||||
this.composeInEdit = AppUserStore.composeInEdit;
|
this.composeInEdit = AppUserStore.composeInEdit;
|
||||||
|
|
||||||
this.folderList = FolderUserStore.folderList;
|
this.systemFolders = FolderUserStore.systemFolders;
|
||||||
this.folderListSystem = FolderUserStore.folderListSystem;
|
|
||||||
this.foldersChanging = FolderUserStore.foldersChanging;
|
|
||||||
|
|
||||||
this.moveAction = moveAction;
|
this.moveAction = moveAction;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
<a class="btn buttonContacts fontastic" data-bind="visible: allowContacts, click: contactsClick" data-i18n="[title]GLOBAL/CONTACTS">📇</a>
|
<a class="btn buttonContacts fontastic" data-bind="visible: allowContacts, click: contactsClick" data-i18n="[title]GLOBAL/CONTACTS">📇</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="b-content">
|
<div class="b-content">
|
||||||
<ul class="b-folders-system" data-bind="foreach: folderListSystem">
|
<ul class="b-folders-system" data-bind="foreach: systemFolders">
|
||||||
<li>
|
<li>
|
||||||
<a data-bind="dropmessages: $data,
|
<a data-bind="dropmessages: $data,
|
||||||
css: { 'selected': selected, 'selectable': selectable, 'anim-action-class': actionBlink, 'is-flagged': isFlagged },
|
css: { 'selected': selected, 'selectable': selectable, 'anim-action-class': actionBlink, 'is-flagged': isFlagged },
|
||||||
|
|
@ -32,7 +32,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="btn-group hide-on-panel-disabled">
|
<div class="btn-group hide-on-panel-disabled">
|
||||||
<a class="btn" data-bind="click: createFolder" data-i18n="[title]POPUPS_CREATE_FOLDER/TITLE_CREATE_FOLDER">
|
<a class="btn" data-bind="click: createFolder" data-i18n="[title]POPUPS_CREATE_FOLDER/TITLE_CREATE_FOLDER">
|
||||||
<i data-bind="css: {'icon-folder-add': !foldersChanging(), 'icon-spinner': foldersChanging()}"></i>
|
<i class="icon-folder-add"></i>
|
||||||
</a>
|
</a>
|
||||||
<a class="btn fontastic" data-bind="click: configureFolders">⚙</a>
|
<a class="btn fontastic" data-bind="click: configureFolders">⚙</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
4
vendors/fontastic/styles.css
vendored
4
vendors/fontastic/styles.css
vendored
|
|
@ -68,10 +68,10 @@
|
||||||
content: "\e033";
|
content: "\e033";
|
||||||
}
|
}
|
||||||
.icon-file-text::before {
|
.icon-file-text::before {
|
||||||
content: "\e034";
|
content: "\e034"; /* 🖹 | 🖺 */
|
||||||
}
|
}
|
||||||
.icon-file-image::before {
|
.icon-file-image::before {
|
||||||
content: "\e036";
|
content: "\e036"; /* 🖻 */
|
||||||
}
|
}
|
||||||
.icon-file-certificate::before {
|
.icon-file-certificate::before {
|
||||||
content: "\e038";
|
content: "\e038";
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue