mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-27 19:19:21 +03:00
Get sorting working for #67
This commit is contained in:
parent
883bf6b026
commit
7eeed62b09
4 changed files with 85 additions and 1 deletions
|
|
@ -6,6 +6,11 @@ html.rl-no-preview-pane {
|
|||
}
|
||||
}
|
||||
|
||||
#sort-list-dropdown-id {
|
||||
padding-left: 6px;
|
||||
padding-right: 6px;
|
||||
}
|
||||
|
||||
.messageList {
|
||||
|
||||
.toolbar {
|
||||
|
|
|
|||
|
|
@ -74,6 +74,7 @@ export class MessageListMailBoxUserView extends AbstractViewRight {
|
|||
this.messageListDisableAutoSelect = MessageUserStore.listDisableAutoSelect;
|
||||
|
||||
this.folderList = FolderUserStore.folderList;
|
||||
this.sortSupported = FolderUserStore.sortSupported;
|
||||
|
||||
this.composeInEdit = AppUserStore.composeInEdit;
|
||||
this.leftPanelDisabled = leftPanelDisabled;
|
||||
|
|
@ -106,6 +107,7 @@ export class MessageListMailBoxUserView extends AbstractViewRight {
|
|||
this.addObservables({
|
||||
moveDropdownTrigger: false,
|
||||
moreDropdownTrigger: false,
|
||||
sortDropdownTrigger: false,
|
||||
|
||||
dragOverArea: null,
|
||||
dragOverBodyArea: null,
|
||||
|
|
@ -174,7 +176,18 @@ export class MessageListMailBoxUserView extends AbstractViewRight {
|
|||
|
||||
mobileCheckedStateHide: () => ThemeStore.isMobile() ? !MessageUserStore.listChecked().length : true,
|
||||
|
||||
messageListFocused: () => Scope.MessageList === AppUserStore.focusedState()
|
||||
messageListFocused: () => Scope.MessageList === AppUserStore.focusedState(),
|
||||
|
||||
sortText: () => {
|
||||
let mode = FolderUserStore.sortMode().split(/\s+/);
|
||||
if ('' === mode[0]) {
|
||||
return '📅⬇';
|
||||
}
|
||||
return (mode.includes('SIZE') ? '✉'
|
||||
: (mode.includes('FROM') ? '@'
|
||||
: (mode.includes('SUBJECT') ? '𝐒' : '📅')))
|
||||
+ (mode.includes('REVERSE') ? '⬇' : '⬆');
|
||||
}
|
||||
});
|
||||
|
||||
this.hasCheckedOrSelectedLines = MessageUserStore.hasCheckedOrSelected,
|
||||
|
|
@ -246,6 +259,11 @@ export class MessageListMailBoxUserView extends AbstractViewRight {
|
|||
});
|
||||
}
|
||||
|
||||
changeSort(self, event) {
|
||||
FolderUserStore.sortMode(event.target.closest('li').dataset.sort);
|
||||
this.reloadCommand();
|
||||
}
|
||||
|
||||
clearCommand() {
|
||||
if (Settings.capa(Capa.DangerousActions)) {
|
||||
showScreenPopup(FolderClearPopupView, [FolderUserStore.currentFolder()]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue