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

fix > in reply

This commit is contained in:
Tankred Hase 2013-10-13 13:49:37 +02:00
parent 382a86d4ee
commit a6088945a6

View File

@ -12,7 +12,7 @@ define(function(require) {
// Controller // Controller
// //
var WriteCtrl = function($scope, $routeParams) { var WriteCtrl = function($scope, $routeParams, $filter) {
$scope.signature = str.signature; $scope.signature = str.signature;
// //
@ -69,6 +69,8 @@ define(function(require) {
} }
function fillFields(re) { function fillFields(re) {
var from, body, bodyRows;
if (!re) { if (!re) {
return; return;
} }
@ -81,10 +83,11 @@ define(function(require) {
$scope.subject = 'Re: ' + ((re.subject) ? re.subject.replace('Re: ', '') : ''); $scope.subject = 'Re: ' + ((re.subject) ? re.subject.replace('Re: ', '') : '');
// fill text body // fill text body
var body = '<br><br>' + re.sentDate + ' ' + re.from[0].name + ' <' + re.from[0].address + '>'; from = re.from[0].name || re.from[0].address;
var bodyRows = re.body.split('\n'); body = '<br><br>' + $filter('date')(re.sentDate, 'EEEE, MMM d, yyyy h:mm a') + ' ' + from + ' wrote:';
bodyRows = re.body.split('\n');
bodyRows.forEach(function(row) { bodyRows.forEach(function(row) {
body += (!re.html) ? '<br> > ' + row : ''; body += (!re.html) ? '<br>' + row : '';
}); });
$scope.body = body; $scope.body = body;
} }
@ -179,7 +182,7 @@ define(function(require) {
require: 'ngModel', require: 'ngModel',
link: function(scope, elm, attrs, ctrl) { link: function(scope, elm, attrs, ctrl) {
// view -> model // view -> model
elm.on('keyup keydown focus', function() { elm.on('keyup keydown', function() {
scope.$apply(function() { scope.$apply(function() {
ctrl.$setViewValue(elm.html()); ctrl.$setViewValue(elm.html());
}); });