(feat) now use mdDialog for message composition

This commit is contained in:
Ludovic Marcotte
2015-08-02 13:25:38 -04:00
parent f44af10cdd
commit ec1420c19b
7 changed files with 167 additions and 120 deletions

View File

@@ -6,8 +6,8 @@
/**
* @ngInject
*/
MessageEditorController.$inject = ['$stateParams', '$state', '$q', 'FileUploader', 'stateAccounts', 'stateMessage', '$timeout', 'encodeUriFilter', 'sgFocus', 'Dialog', 'Account', 'Mailbox', 'AddressBook', 'Preferences'];
function MessageEditorController($stateParams, $state, $q, FileUploader, stateAccounts, stateMessage, $timeout, encodeUriFilter, focus, Dialog, Account, Mailbox, AddressBook, Preferences) {
MessageEditorController.$inject = ['$stateParams', '$state', '$q', '$mdDialog', 'FileUploader', 'stateAccounts', 'stateMessage', '$timeout', 'encodeUriFilter', 'sgFocus', 'Dialog', 'Account', 'Mailbox', 'AddressBook', 'Preferences'];
function MessageEditorController($stateParams, $state, $q, $mdDialog, FileUploader, stateAccounts, stateMessage, $timeout, encodeUriFilter, focus, Dialog, Account, Mailbox, AddressBook, Preferences) {
var vm = this;
vm.autocomplete = {to: {}, cc: {}, bcc: {}};
@@ -71,10 +71,7 @@
if (vm.autosave)
$timeout.cancel(vm.autosave);
if ($state.params.mailboxId)
$state.go('mail.account.mailbox', { accountId: $state.params.accountId, mailboxId: $state.params.mailboxId });
else
$state.go('mail');
$mdDialog.cancel();
}
function send() {
@@ -82,7 +79,7 @@
$timeout.cancel(vm.autosave);
vm.message.$send().then(function(data) {
$state.go('mail');
$mdDialog.hide();
}, function(data) {
Dialog.alert(l(data.status), l(data.message));
});