diff --git a/src/js/controller/mail-list.js b/src/js/controller/mail-list.js index 70dd366..b5623de 100644 --- a/src/js/controller/mail-list.js +++ b/src/js/controller/mail-list.js @@ -62,11 +62,6 @@ define(function(require) { $scope.state.mailList.selected = email; - // split text only emails into parts for easier rendering - if (!email.html && typeof email.body === 'string') { - email.bodyDisplayLines = email.body.split('\n'); - } - // mark selected message as 'read' markAsRead(email); }; diff --git a/src/js/controller/read.js b/src/js/controller/read.js index c2bf5d4..63715d4 100644 --- a/src/js/controller/read.js +++ b/src/js/controller/read.js @@ -14,6 +14,10 @@ define(function(require) { this.open = to; } }; + + $scope.lineEmpty = function(line) { + return line.replace(/>/g, '').trim().length === 0; + }; }; // diff --git a/src/js/controller/write.js b/src/js/controller/write.js index 46a8315..ca5a5cd 100644 --- a/src/js/controller/write.js +++ b/src/js/controller/write.js @@ -62,12 +62,12 @@ define(function(require) { // fill text body from = re.from[0].name || re.from[0].address; - body = '

' + $filter('date')(re.sentDate, 'EEEE, MMM d, yyyy h:mm a') + ' ' + from + ' wrote:

'; + body = '

' + $filter('date')(re.sentDate, 'EEEE, MMM d, yyyy h:mm a') + ' ' + from + ' wrote:
> '; // clean text from markup if to prevent injection in contenteditable if (!re.html) { cleaned = angular.element('

' + re.body + '

').text(); - body += cleaned.split('\n').join('
'); + body += cleaned.split('\n').join('
> '); $scope.body = body; } } diff --git a/src/sass/views/_read.scss b/src/sass/views/_read.scss index 69a0676..0c43330 100644 --- a/src/sass/views/_read.scss +++ b/src/sass/views/_read.scss @@ -17,7 +17,7 @@ .date { color: $color-grey-light; font-size: $font-size-small; - margin-top: 0.5em; + margin-top: 0.25em; margin-bottom: 1.5em; padding: 0px; } @@ -37,7 +37,7 @@ color: $color-grey-lighter; background-color: $color-grey-lighter; margin-top: 1em; - margin-bottom: 1.5em; + margin-bottom: 1.75em; } .body { @@ -46,6 +46,10 @@ line-height: 1.5em; height: 100%; overflow-y: scroll; + + .empty-line { + line-height: 1em; + } } iframe { diff --git a/src/tpl/read.html b/src/tpl/read.html index e064dfa..17af8a9 100644 --- a/src/tpl/read.html +++ b/src/tpl/read.html @@ -20,9 +20,9 @@
- - + +
{{line}}
- +
\ No newline at end of file