1
0
mirror of https://github.com/moparisthebest/mail synced 2024-12-22 23:38:48 -05:00

[WO-448] Do not show reader on first select in mobile mode

This commit is contained in:
Tankred Hase 2014-07-21 16:05:29 +02:00
parent 23298e8f12
commit 2019f7f657
2 changed files with 12 additions and 7 deletions

View File

@ -5,12 +5,12 @@ define(function(require) {
_ = require('underscore'),
appController = require('js/app-controller'),
notification = require('js/util/notification'),
emailDao, outboxBo, keychainDao, searchTimeout;
emailDao, outboxBo, keychainDao, searchTimeout, firstSelect;
var INIT_DISPLAY_LEN = 20,
SCROLL_DISPLAY_LEN = 10;
var MailListCtrl = function($scope, $timeout) {
var MailListCtrl = function($scope) {
//
// Init
//
@ -56,7 +56,12 @@ define(function(require) {
}
$scope.state.mailList.selected = email;
$scope.state.read.toggle(true);
if (!firstSelect) {
// only toggle to read view on 2nd select in mobile mode
$scope.state.read.toggle(true);
}
firstSelect = false;
keychainDao.refreshKeyForUserId(email.from[0].address, onKeyRefreshed);
@ -183,9 +188,8 @@ define(function(require) {
// Shows the next message based on the uid of the currently selected element
if (currentFolder().messages.indexOf(currentMessage()) === -1) {
$timeout(function() {
$scope.select($scope.displayMessages[0]);
});
firstSelect = true; // reset first selection
$scope.select($scope.displayMessages[0]);
}
});
@ -388,6 +392,7 @@ define(function(require) {
return;
}
firstSelect = false;
$scope.select(_.findWhere(currentFolder().messages, {
uid: uid
}));

View File

@ -458,7 +458,7 @@ define(function(require) {
scope.remove(mail);
expect(emailDaoMock.deleteMessage.calledOnce).to.be.true;
expect(scope.state.mailList.selected).to.not.exist;
expect(scope.state.mailList.selected).to.exist;
});
});
});