(feat) compose mail with clicked email address

This commit is contained in:
Ludovic Marcotte
2015-08-09 10:36:54 -04:00
parent ad9b969d6d
commit dd7b929f17
5 changed files with 32 additions and 9 deletions
@@ -21,6 +21,7 @@
vm.replyAll = replyAll;
vm.forward = forward;
vm.edit = edit;
vm.newMessage = newMessage;
vm.viewRawSource = viewRawSource;
// Watch the message model "flags" attribute to remove on-the-fly a tag from the IMAP message
@@ -46,7 +47,11 @@
});
}
function showMailEditor($event, message) {
function showMailEditor($event, message, recipients) {
if (!angular.isDefined(recipients))
recipients = [];
$mdDialog.show({
parent: angular.element(document.body),
targetEvent: $event,
@@ -57,7 +62,8 @@
controllerAs: 'editor',
locals: {
stateAccounts: vm.accounts,
stateMessage: message
stateMessage: message,
stateRecipients: recipients
}
});
}
@@ -83,6 +89,12 @@
});
}
function newMessage($event, recipient) {
var message = vm.account.$newMessage();
showMailEditor($event, message, [recipient]);
}
function viewRawSource($event) {
Message.$$resource.post(vm.message.id, "viewsource").then(function(data) {
$mdDialog.show({