From badfd6f87b4292b3cf0e971c9cac5ca0101e3376 Mon Sep 17 00:00:00 2001 From: Tankred Hase Date: Thu, 12 Sep 2013 00:04:36 +0200 Subject: [PATCH] fix dummymails in chrome --- src/js/controller/message-list.js | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/js/controller/message-list.js b/src/js/controller/message-list.js index 5cc22a1..c705b8e 100644 --- a/src/js/controller/message-list.js +++ b/src/js/controller/message-list.js @@ -18,30 +18,30 @@ define(function(require) { var replyToId = (replyTo) ? replyTo.uid : '', url = 'index.html#/write/' + replyToId; - if (!window.chrome) { - window.open(url, 'Compose Message', 'toolbar=no,width=800,height=600,left=500,top=200,status=no,scrollbars=no,resize=no'); + if (window.chrome && chrome.app.window) { + chrome.app.window.create(url, { + 'bounds': { + 'width': 800, + 'height': 600 + } + }); return; } - chrome.app.window.create(url, { - 'bounds': { - 'width': 800, - 'height': 600 - } - }); + window.open(url, 'Compose Message', 'toolbar=no,width=800,height=600,left=500,top=200,status=no,scrollbars=no,resize=no'); }; - if (!window.chrome) { - createDummyMails(function(emails) { + if (window.chrome && window.chrome.identity) { + fetchList(function(emails) { $scope.emails = emails; - $scope.select($scope.emails[0]); + $scope.$apply(); }); return; } - fetchList(function(emails) { + createDummyMails(function(emails) { $scope.emails = emails; - $scope.$apply(); + $scope.select($scope.emails[0]); }); };