From 558ffb4599415a313be540ff9c08f0ca4518fb22 Mon Sep 17 00:00:00 2001 From: Tankred Hase Date: Sat, 19 Oct 2013 03:32:00 +0200 Subject: [PATCH] minor cleanup --- src/js/controller/navigation.js | 6 +----- src/js/controller/write.js | 20 ++++++++++++++++---- src/sass/_variables.scss | 2 +- 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/src/js/controller/navigation.js b/src/js/controller/navigation.js index 35d3d46..71d0e05 100644 --- a/src/js/controller/navigation.js +++ b/src/js/controller/navigation.js @@ -29,11 +29,7 @@ define(function(require) { }; $scope.openWriter = function(replyTo) { - if (replyTo) { - $scope.writerTitle = 'Reply'; - } else { - $scope.writerTitle = 'New email'; - } + $scope.writerReply = !! (replyTo); $scope.writerOpen = true; }; diff --git a/src/js/controller/write.js b/src/js/controller/write.js index 7051afb..1682b30 100644 --- a/src/js/controller/write.js +++ b/src/js/controller/write.js @@ -12,14 +12,27 @@ define(function(require) { // Controller // - var WriteCtrl = function($scope, $routeParams, $filter) { + var WriteCtrl = function($scope, $filter) { $scope.signature = str.signature; + emailDao = appController._emailDao; // // Init // - emailDao = appController._emailDao; + $scope.$watch('writerOpen', function() { + resetFields(); + if ($scope.writerReply) { + fillFields($scope.selected); + } + }); + + function resetFields() { + $scope.writerTitle = 'New email'; + $scope.to = undefined; + $scope.subject = undefined; + $scope.body = undefined; + } function fillFields(re) { var from, body, bodyRows; @@ -28,8 +41,7 @@ define(function(require) { return; } - // fille title - $scope.title = 'Reply'; + $scope.writerTitle = 'Reply'; // fill recipient field $scope.to = re.from[0].address; // fill subject diff --git a/src/sass/_variables.scss b/src/sass/_variables.scss index 502ba58..b81fabf 100755 --- a/src/sass/_variables.scss +++ b/src/sass/_variables.scss @@ -48,7 +48,7 @@ $lightbox-padding: 15px; $lightbox-max-width: 662px; $lightbox-width: 90%; $lightbox-min-height: 644px; -$lightbox-top: 10%; +$lightbox-top: 7.5%; $btn-back-color: $color-blue; $btn-color: #fff;