(js) Restore caret position in message editor

Cont'd.

Fixes #4517
This commit is contained in:
Francis Lachapelle
2018-08-21 10:43:01 -04:00
parent bfd2481a9c
commit e81cf29e4c
2 changed files with 10 additions and 4 deletions
@@ -215,7 +215,6 @@
'new']
.join('/'),
wId = vm.selectedFolder.$id() + '/' + Math.random(0, 1000);
console.debug(url);
$window.open(url, wId,
["width=680",
"height=520",
@@ -237,8 +237,9 @@
/**
* @ngInject
*/
MessageEditorControllerPopup.$inject = ['$window', '$mdDialog', 'stateAccount', 'stateMessage'];
function MessageEditorControllerPopup($window, $mdDialog, stateAccount, stateMessage) {
MessageEditorControllerPopup.$inject = ['$window', '$q', '$mdDialog', 'stateAccount', 'stateMessage'];
function MessageEditorControllerPopup($window, $q, $mdDialog, stateAccount, stateMessage) {
var onCompleteDeferred = $q.defer();
$mdDialog
.show({
hasBackdrop: false,
@@ -248,9 +249,15 @@
templateUrl: 'UIxMailEditor',
controller: 'MessageEditorController',
controllerAs: 'editor',
onComplete: function (scope, element) {
return onCompleteDeferred.resolve(element);
},
locals: {
stateAccount: stateAccount,
stateMessage: stateMessage
stateMessage: stateMessage,
onCompletePromise: function () {
return onCompleteDeferred.promise;
}
}
})
.finally(function() {