From 1974c19a55529a78acae170aa1ec1b62e03d67aa Mon Sep 17 00:00:00 2001 From: Tankred Hase Date: Wed, 11 Sep 2013 21:01:05 +0200 Subject: [PATCH] open new window for write view --- src/js/app.js | 13 ++++++++++++- src/js/controller/message-list.js | 10 ++++++++++ src/tpl/read.html | 2 +- 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/src/js/app.js b/src/js/app.js index 4750938..29bce9d 100644 --- a/src/js/app.js +++ b/src/js/app.js @@ -1,7 +1,14 @@ // hey Angular, we're bootstrapping manually! window.name = 'NG_DEFER_BOOTSTRAP!'; -require(['angular', 'js/controller/message-list', 'angularRoute', 'angularTouch', 'js/app-config'], function(angular, MessageListCtrl) { +require([ + 'angular', + 'js/controller/message-list', + 'js/controller/write', + 'angularRoute', + 'angularTouch', + 'js/app-config' +], function(angular, MessageListCtrl, WriteCtrl) { 'use strict'; var app = angular.module('mail', ['ngRoute', 'ngTouch']); @@ -14,6 +21,10 @@ require(['angular', 'js/controller/message-list', 'angularRoute', 'angularTouch' templateUrl: 'tpl/read.html', controller: MessageListCtrl }); + $routeProvider.when('/write/:replyToId', { + templateUrl: 'tpl/write.html', + controller: WriteCtrl + }); $routeProvider.otherwise({ redirectTo: '/folders/Inbox' }); diff --git a/src/js/controller/message-list.js b/src/js/controller/message-list.js index 71c7560..a3dd655 100644 --- a/src/js/controller/message-list.js +++ b/src/js/controller/message-list.js @@ -13,6 +13,16 @@ define(function(require) { $scope.selected = email; }; + $scope.write = function(replyTo) { + var replyToId = (replyTo) ? replyTo.uid : ''; + chrome.app.window.create('index.html#/write/' + replyToId, { + 'bounds': { + 'width': 800, + 'height': 600 + } + }); + }; + if (true) { createDummyMails(function(emails) { $scope.emails = emails; diff --git a/src/tpl/read.html b/src/tpl/read.html index e6158c0..8a8fa3f 100644 --- a/src/tpl/read.html +++ b/src/tpl/read.html @@ -1,5 +1,5 @@
-
+