(js) Draft: update subject in list/detail views

Update the subject everywhere when saving a draft.
pull/239/head
Francis Lachapelle 2018-01-17 11:04:22 -05:00
parent b39d3db674
commit 4133a0b954
2 changed files with 7 additions and 2 deletions

View File

@ -124,7 +124,7 @@
</md-card-actions>
<md-card-content>
<div class="sg-padded">
<h5 ng-bind="::viewer.message.subject"><!-- subject --></h5>
<h5 ng-bind="viewer.message.subject"><!-- subject --></h5>
<time class="msg-date" datetime="viewer.message.date" ng-bind="::viewer.message.date"><!-- date --></time>
</div>
<div>

View File

@ -28,12 +28,17 @@
this.$onInit = function () {
var watchedAttrs = ['uid', 'isread', 'isflagged', 'flags', 'subject'];
// this.service = Message;
this.MailboxService = Mailbox;
if (Mailbox.selectedFolder.type == 'draft')
watchedAttrs.push('subject');
$scope.$watch(
function() {
return $ctrl.message? [ _.pick($ctrl.message, ['uid', 'isread', 'isflagged', 'flags']) ] : null;
return $ctrl.message? [ _.pick($ctrl.message, watchedAttrs) ] : null;
},
function(newId, oldId) {
if ($ctrl.message) {