From 66a492157396050f15a40388011c80e0dd4d4469 Mon Sep 17 00:00:00 2001 From: Tankred Hase Date: Fri, 11 Oct 2013 23:45:30 +0200 Subject: [PATCH] ui works in dev mode again --- src/js/controller/navigation.js | 43 ++++++++++++++++++++++----------- 1 file changed, 29 insertions(+), 14 deletions(-) diff --git a/src/js/controller/navigation.js b/src/js/controller/navigation.js index 0d8c1a7..4c73a6d 100644 --- a/src/js/controller/navigation.js +++ b/src/js/controller/navigation.js @@ -9,13 +9,6 @@ define(function(require) { emailDao = appController._emailDao; - initFolders(function(folders) { - $scope.folders = folders; - // select inbox as the current folder on init - $scope.openFolder($scope.folders[0]); - $scope.$apply(); - }); - // // scope functions // @@ -50,19 +43,41 @@ define(function(require) { window.open(url, 'Compose Message', 'toolbar=no,width=720,height=640,left=500,top=200,status=no,scrollbars=no,resize=no'); }; + initFolders(function(folders) { + $scope.folders = folders; + // select inbox as the current folder on init + $scope.openFolder($scope.folders[0]); + }); + // // helper functions // function initFolders(callback) { - emailDao.imapListFolders(function(err, folders) { - if (err) { - console.log(err); - return; - } + if (window.chrome && chrome.identity) { + emailDao.imapListFolders(function(err, folders) { + if (err) { + console.log(err); + return; + } - callback(folders); - }); + callback(folders); + $scope.$apply(); + }); + return; + } + + callback([{ + type: 'Inbox' + }, { + type: 'Sent' + }, { + type: 'Outbox' + }, { + type: 'Drafts' + }, { + type: 'Trash' + }]); } };