(js) Fix selection of search results in Webmail
When performing a search from the special router state "mail.account.inbox", the first selection was changing the state name and resetting the search. The special "inbox" state will now force a URL change to avoid this problem.
This commit is contained in:
parent
599264b3d9
commit
72a38c51b4
|
@ -40,7 +40,7 @@
|
|||
if (Mailbox.$virtualMode)
|
||||
$state.go('mail.account.virtualMailbox.message', {accountId: stateAccount.id, mailboxId: encodeUriFilter(message.$mailbox.path), messageId: message.uid});
|
||||
else
|
||||
$state.go('mail.account.mailbox.message', {accountId: stateAccount.id, mailboxId: encodeUriFilter(message.$mailbox.path), messageId: message.uid});
|
||||
$state.go('mail.account.mailbox.message', {messageId: message.uid});
|
||||
}
|
||||
|
||||
function toggleMessageSelection($event, message) {
|
||||
|
|
|
@ -69,17 +69,7 @@
|
|||
})
|
||||
.state('mail.account.inbox', {
|
||||
url: '/inbox',
|
||||
views: {
|
||||
'mailbox@mail': {
|
||||
templateUrl: 'UIxMailFolderTemplate', // UI/Templates/MailerUI/UIxMailFolderTemplate.wox
|
||||
controller: 'MailboxController',
|
||||
controllerAs: 'mailbox'
|
||||
}
|
||||
},
|
||||
resolve: {
|
||||
stateMailbox: stateInbox,
|
||||
stateMessages: stateMessages
|
||||
}
|
||||
onEnter: onEnterInbox
|
||||
})
|
||||
.state('mail.account.mailbox', {
|
||||
url: '/:mailboxId',
|
||||
|
@ -219,12 +209,11 @@
|
|||
/**
|
||||
* @ngInject
|
||||
*/
|
||||
stateInbox.$inject = ['stateAccount', 'Mailbox'];
|
||||
function stateInbox(stateAccount, Mailbox) {
|
||||
if (Mailbox.selectedFolder)
|
||||
Mailbox.selectedFolder.$isLoading = true;
|
||||
|
||||
return stateAccount.$mailboxes[0];
|
||||
onEnterInbox.$inject = ['$window', '$state', 'encodeUriFilter', 'stateAccount'];
|
||||
function onEnterInbox($window, $state, encodeUriFilter, stateAccount) {
|
||||
$window.location.hash = $state.href('mail.account.mailbox',
|
||||
{accountId: stateAccount.id,
|
||||
mailboxId: encodeUriFilter(stateAccount.$mailboxes[0].path)});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue