mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-01-05 07:35:34 +08:00
fix(thread-list): Show an attachment indicator using thread metadata
This commit is contained in:
parent
63f5c4091d
commit
741f360df5
3 changed files with 19 additions and 9 deletions
|
@ -85,13 +85,14 @@ class ThreadList extends React.Component
|
|||
name: "Message"
|
||||
flex: 4
|
||||
resolver: (thread) =>
|
||||
attachments = []
|
||||
if thread.hasAttachments
|
||||
attachments = <div className="thread-icon thread-icon-attachment"></div>
|
||||
attachment = []
|
||||
hasAttachments = _.find (thread.metadata ? []), (m) -> m.files.length > 0
|
||||
if hasAttachments
|
||||
attachment = <div className="thread-icon thread-icon-attachment"></div>
|
||||
<span className="details">
|
||||
<span className="subject">{subject(thread.subject)}</span>
|
||||
<span className="snippet">{thread.snippet}</span>
|
||||
{attachments}
|
||||
{attachment}
|
||||
</span>
|
||||
|
||||
c4 = new ListTabular.Column
|
||||
|
@ -111,16 +112,23 @@ class ThreadList extends React.Component
|
|||
flex: 1
|
||||
resolver: (thread) =>
|
||||
pencil = []
|
||||
attachment = []
|
||||
hasDraft = _.find (thread.metadata ? []), (m) -> m.draft
|
||||
hasAttachments = _.find (thread.metadata ? []), (m) -> m.files.length > 0
|
||||
if hasDraft
|
||||
pencil = <RetinaImg name="icon-draft-pencil.png" className="draft-icon" mode={RetinaImg.Mode.ContentPreserve} />
|
||||
|
||||
if hasAttachments
|
||||
attachment = <div className="thread-icon thread-icon-attachment"></div>
|
||||
|
||||
<div>
|
||||
<div style={display: 'flex'}>
|
||||
<ThreadListIcon thread={thread} />
|
||||
<ThreadListParticipants thread={thread} />
|
||||
<span className="timestamp">{timestamp(thread.lastMessageTimestamp)}</span>
|
||||
{pencil}
|
||||
<span style={flex:1}></span>
|
||||
{attachment}
|
||||
<span className="timestamp">{timestamp(thread.lastMessageTimestamp)}</span>
|
||||
</div>
|
||||
<div className="subject">{subject(thread.subject)}</div>
|
||||
<div className="snippet">{thread.snippet}</div>
|
||||
|
|
|
@ -83,8 +83,10 @@
|
|||
position: relative;
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
flex-shrink:0;
|
||||
top:2px;
|
||||
|
||||
// Shrink, but only after snippet has shrunk
|
||||
flex-shrink:0.1;
|
||||
}
|
||||
.snippet {
|
||||
font-size: @font-size-small;
|
||||
|
@ -94,6 +96,7 @@
|
|||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
top:2px;
|
||||
flex: 1;
|
||||
}
|
||||
.thread-icon {
|
||||
flex-shrink:0;
|
||||
|
@ -146,6 +149,8 @@
|
|||
}
|
||||
.thread-icon-attachment {
|
||||
background-image:url(../static/images/thread-list/icon-attachment-@2x.png);
|
||||
margin-right:-15px;
|
||||
margin-left:0;
|
||||
}
|
||||
.thread-icon-unread {
|
||||
background-image:url(../static/images/thread-list/icon-unread-@2x.png);
|
||||
|
@ -250,7 +255,6 @@
|
|||
|
||||
.thread-list-narrow {
|
||||
.timestamp {
|
||||
flex: 1;
|
||||
order: 100;
|
||||
}
|
||||
.participants {
|
||||
|
|
|
@ -116,6 +116,4 @@ class Thread extends Model
|
|||
hasLabelName: (name) -> @hasCategoryName(name)
|
||||
hasFolderName: (name) -> @hasCategoryName(name)
|
||||
|
||||
hasAttachments: null ## TODO
|
||||
|
||||
module.exports = Thread
|
||||
|
|
Loading…
Reference in a new issue