mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
Replace {'inbox-star-icon': isInboxStarred} with {'flag-icon': isFlagged} for future improvements
This commit is contained in:
parent
db1615f2ca
commit
8934205ede
6 changed files with 14 additions and 17 deletions
|
|
@ -10,6 +10,7 @@ import * as Local from 'Storage/Client';
|
||||||
|
|
||||||
import { AppUserStore } from 'Stores/User/App';
|
import { AppUserStore } from 'Stores/User/App';
|
||||||
import { FolderUserStore } from 'Stores/User/Folder';
|
import { FolderUserStore } from 'Stores/User/Folder';
|
||||||
|
import { MessageUserStore } from 'Stores/User/Message';
|
||||||
import { SettingsUserStore } from 'Stores/User/Settings';
|
import { SettingsUserStore } from 'Stores/User/Settings';
|
||||||
|
|
||||||
import ko from 'ko';
|
import ko from 'ko';
|
||||||
|
|
@ -252,6 +253,9 @@ export class FolderModel extends AbstractModel {
|
||||||
|
|
||||||
isInbox: () => FolderType.Inbox === folder.type(),
|
isInbox: () => FolderType.Inbox === folder.type(),
|
||||||
|
|
||||||
|
isFlagged: () => FolderUserStore.currentFolder() === folder
|
||||||
|
&& MessageUserStore.listSearch().trim().includes('is:flagged'),
|
||||||
|
|
||||||
hasSubscribedSubfolders:
|
hasSubscribedSubfolders:
|
||||||
() => !!folder.subFolders().find(
|
() => !!folder.subFolders().find(
|
||||||
oFolder => {
|
oFolder => {
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ import { PgpUserStore } from 'Stores/User/Pgp';
|
||||||
import { SettingsUserStore } from 'Stores/User/Settings';
|
import { SettingsUserStore } from 'Stores/User/Settings';
|
||||||
import { NotificationUserStore } from 'Stores/User/Notification';
|
import { NotificationUserStore } from 'Stores/User/Notification';
|
||||||
|
|
||||||
import Remote from 'Remote/User/Fetch';
|
//import Remote from 'Remote/User/Fetch'; Circular dependency
|
||||||
|
|
||||||
const
|
const
|
||||||
hcont = Element.fromHTML('<div area="hidden" style="position:absolute;left:-5000px"></div>'),
|
hcont = Element.fromHTML('<div area="hidden" style="position:absolute;left:-5000px"></div>'),
|
||||||
|
|
@ -617,7 +617,7 @@ export const MessageUserStore = new class {
|
||||||
if (oMessage) {
|
if (oMessage) {
|
||||||
preload || this.hideMessageBodies();
|
preload || this.hideMessageBodies();
|
||||||
preload || this.messageLoading(true);
|
preload || this.messageLoading(true);
|
||||||
Remote.message((iError, oData, bCached) => {
|
rl.app.Remote.message((iError, oData, bCached) => {
|
||||||
if (iError) {
|
if (iError) {
|
||||||
if (Notification.RequestAborted !== iError && !preload) {
|
if (Notification.RequestAborted !== iError && !preload) {
|
||||||
this.message(null);
|
this.message(null);
|
||||||
|
|
|
||||||
|
|
@ -175,15 +175,15 @@
|
||||||
right: 0;
|
right: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.inbox-star-icon {
|
.flag-icon {
|
||||||
margin-left: 7px;
|
margin-left: 7px;
|
||||||
}
|
}
|
||||||
.inbox-star-icon::after {
|
.flag-icon::after {
|
||||||
content:'☆';
|
content:'☆';
|
||||||
opacity: .5;
|
opacity: .5;
|
||||||
}
|
}
|
||||||
&.inbox-is-starred {
|
.is-flagged {
|
||||||
.inbox-star-icon::after {
|
.flag-icon::after {
|
||||||
color: orange;
|
color: orange;
|
||||||
content:'★';
|
content:'★';
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
|
|
|
||||||
|
|
@ -40,13 +40,6 @@ export class FolderListMailBoxUserView extends AbstractViewLeft {
|
||||||
this.allowContacts = AppUserStore.allowContacts();
|
this.allowContacts = AppUserStore.allowContacts();
|
||||||
|
|
||||||
this.folderListFocused = ko.computed(() => Scope.FolderList === AppUserStore.focusedState());
|
this.folderListFocused = ko.computed(() => Scope.FolderList === AppUserStore.focusedState());
|
||||||
|
|
||||||
this.isInboxStarred = ko.computed(
|
|
||||||
() =>
|
|
||||||
FolderUserStore.currentFolder() &&
|
|
||||||
FolderUserStore.currentFolder().isInbox() &&
|
|
||||||
MessageUserStore.listSearch().trim().includes('is:flagged')
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
onBuild(dom) {
|
onBuild(dom) {
|
||||||
|
|
@ -93,7 +86,7 @@ export class FolderListMailBoxUserView extends AbstractViewLeft {
|
||||||
setFolderHash(folder.fullNameRaw, '');
|
setFolderHash(folder.fullNameRaw, '');
|
||||||
}
|
}
|
||||||
|
|
||||||
rl.route.setHash((eqs(event, '.b-folders li a.selectable .inbox-star-icon') && !this.isInboxStarred())
|
rl.route.setHash((eqs(event, '.b-folders li a.selectable .flag-icon') && !folder.isFlagged())
|
||||||
? mailBox(folder.fullNameHash, 1, 'is:flagged')
|
? mailBox(folder.fullNameHash, 1, 'is:flagged')
|
||||||
: mailBox(folder.fullNameHash)
|
: mailBox(folder.fullNameHash)
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
<div class="b-folders g-ui-user-select-none" data-bind="css: {'focused': folderListFocused, 'single-root-inbox': foldersListWithSingleInboxRootFolder, 'inbox-is-starred': isInboxStarred}">
|
<div class="b-folders g-ui-user-select-none" data-bind="css: {'focused': folderListFocused, 'single-root-inbox': foldersListWithSingleInboxRootFolder}">
|
||||||
<div class="b-toolbar btn-toolbar hide-mobile">
|
<div class="b-toolbar btn-toolbar hide-mobile">
|
||||||
<a class="btn buttonCompose" data-bind="visible: allowComposer, click: composeClick, css: {'btn-warning': composeInEdit, 'btn-success': !composeInEdit()}" data-i18n="[title]FOLDER_LIST/BUTTON_NEW_MESSAGE">
|
<a class="btn buttonCompose" data-bind="visible: allowComposer, click: composeClick, css: {'btn-warning': composeInEdit, 'btn-success': !composeInEdit()}" data-i18n="[title]FOLDER_LIST/BUTTON_NEW_MESSAGE">
|
||||||
<i class="icon-paper-plane"></i>
|
<i class="icon-paper-plane"></i>
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
<li>
|
<li>
|
||||||
<a data-bind="dropmessages: $data,
|
<a data-bind="dropmessages: $data,
|
||||||
css: { 'selected': selected, 'selectable': selectable, 'anim-action-class': actionBlink },
|
css: { 'selected': selected, 'selectable': selectable, 'anim-action-class': actionBlink, 'is-flagged': isFlagged },
|
||||||
attr: { 'data-unread': printableUnreadCount }">
|
attr: { 'data-unread': printableUnreadCount }">
|
||||||
<!-- ko text: localName --><!-- /ko -->
|
<!-- ko text: localName --><!-- /ko -->
|
||||||
<!-- ko if: isInbox -->
|
<!-- ko if: isInbox -->
|
||||||
<span class="inbox-star-icon fontastic"></span>
|
<span class="flag-icon fontastic"></span>
|
||||||
<!-- /ko -->
|
<!-- /ko -->
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue