From d99c7acb50d4a25c288de3b87fe97c7f38e498a2 Mon Sep 17 00:00:00 2001 From: Tankred Hase Date: Fri, 11 Oct 2013 23:27:55 +0200 Subject: [PATCH] fix ui init and only mark email as read if manually selected --- src/js/controller/mail-list.js | 11 +++++++++-- src/js/controller/navigation.js | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/js/controller/mail-list.js b/src/js/controller/mail-list.js index fd15b95..c108f41 100644 --- a/src/js/controller/mail-list.js +++ b/src/js/controller/mail-list.js @@ -7,7 +7,8 @@ define(function(require) { var MailListCtrl = function($scope) { var offset = 0, - num = 100; + num = 100, + firstSelect = true; emailDao = appController._emailDao; @@ -72,6 +73,7 @@ define(function(require) { // function initList() { + firstSelect = true; updateStatus('Read cache ...'); // list messaged from local db @@ -157,8 +159,13 @@ define(function(require) { } function markAsRead(email) { - email.unread = false; + // don't mark top selected email automatically + if (firstSelect) { + firstSelect = false; + return; + } + email.unread = false; emailDao.imapMarkMessageRead({ folder: getFolder().path, uid: email.uid diff --git a/src/js/controller/navigation.js b/src/js/controller/navigation.js index 124613f..0d8c1a7 100644 --- a/src/js/controller/navigation.js +++ b/src/js/controller/navigation.js @@ -11,9 +11,9 @@ define(function(require) { initFolders(function(folders) { $scope.folders = folders; - $scope.$apply(); // select inbox as the current folder on init $scope.openFolder($scope.folders[0]); + $scope.$apply(); }); //