1
0
mirror of https://github.com/moparisthebest/mail synced 2024-11-27 03:12:23 -05:00

merge email list and message body objects in email dao

This commit is contained in:
Tankred Hase 2013-09-30 17:29:29 +02:00
parent ab5e5a573d
commit 8a40de92ea
3 changed files with 10 additions and 4 deletions

View File

@ -143,7 +143,7 @@ define(function(require) {
}; };
function createDummyMails(callback) { function createDummyMails(callback) {
var Email = function(unread, attachments, replied) { var Email = function(unread, attachments, answered) {
this.uid = '1'; this.uid = '1';
this.from = [{ this.from = [{
name: 'Whiteout Support', name: 'Whiteout Support',
@ -154,7 +154,7 @@ define(function(require) {
}]; // list of receivers }]; // list of receivers
this.attachments = (attachments) ? [true] : undefined; this.attachments = (attachments) ? [true] : undefined;
this.unread = unread; this.unread = unread;
this.replied = replied; this.answered = answered;
this.sentDate = new Date('Thu Sep 19 2013 20:41:23 GMT+0200 (CEST)'); this.sentDate = new Date('Thu Sep 19 2013 20:41:23 GMT+0200 (CEST)');
this.subject = "Welcome Max"; // Subject line this.subject = "Welcome Max"; // Subject line
this.body = "Hi Max,\n\n" + this.body = "Hi Max,\n\n" +

View File

@ -484,7 +484,13 @@ define(function(require) {
return; return;
} }
emails.push(message); // set gotten attributes like body to message object containing list meta data like 'unread' or 'replied'
messageItem.id = message.id;
messageItem.body = message.body;
messageItem.html = message.html;
messageItem.attachments = message.attachments;
emails.push(messageItem);
after(); after();
}); });
}); });

View File

@ -4,7 +4,7 @@
</header> </header>
<ul class="mail-list"> <ul class="mail-list">
<li ng-class="{'mail-list-active': email === selected, 'mail-list-attachment': email.attachments !== undefined && email.attachments.length > 0, 'mail-list-unread': email.unread, 'mail-list-replied': email.replied}" ng-click="select(email)" ng-repeat="email in emails"> <li ng-class="{'mail-list-active': email === selected, 'mail-list-attachment': email.attachments !== undefined && email.attachments.length > 0, 'mail-list-unread': email.unread, 'mail-list-replied': email.answered}" ng-click="select(email)" ng-repeat="email in emails">
<h3>{{email.from[0].name || email.from[0].address}}</h3> <h3>{{email.from[0].name || email.from[0].address}}</h3>
<div class="head"> <div class="head">
<p class="subject">{{email.subject}}</p> <p class="subject">{{email.subject}}</p>