(js) Scroll to previously selected message

pull/188/head
Francis Lachapelle 2016-01-18 14:33:31 -05:00
parent 691ab3ff27
commit 3787296fd6
1 changed files with 9 additions and 3 deletions

View File

@ -6,8 +6,8 @@
/**
* @ngInject
*/
MailboxController.$inject = ['$window', '$state', '$mdDialog', 'stateAccounts', 'stateAccount', 'stateMailbox', 'encodeUriFilter', 'Dialog', 'Account', 'Mailbox'];
function MailboxController($window, $state, $mdDialog, stateAccounts, stateAccount, stateMailbox, encodeUriFilter, Dialog, Account, Mailbox) {
MailboxController.$inject = ['$window', '$timeout', '$state', '$mdDialog', 'stateAccounts', 'stateAccount', 'stateMailbox', 'encodeUriFilter', 'Dialog', 'Account', 'Mailbox'];
function MailboxController($window, $timeout, $state, $mdDialog, stateAccounts, stateAccount, stateMailbox, encodeUriFilter, Dialog, Account, Mailbox) {
var vm = this, messageDialog = null;
// Expose controller
@ -163,7 +163,13 @@
function cancelSearch() {
vm.mode.search = false;
vm.selectedFolder.$filter();
vm.selectedFolder.$filter().then(function() {
if (vm.selectedFolder.selectedMessage) {
$timeout(function() {
vm.selectedFolder.$topIndex = vm.selectedFolder.uidsMap[vm.selectedFolder.selectedMessage];
});
}
});
}
function newMessage($event) {