From c4e2f661725f803d3ae36623c0e50cbc2b22310d Mon Sep 17 00:00:00 2001 From: Tankred Hase Date: Tue, 17 Jun 2014 17:22:56 +0200 Subject: [PATCH] Fix bug that catches empty string in writer email-header auto-size directice --- src/js/controller/write.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/js/controller/write.js b/src/js/controller/write.js index 4d9728c..97a9d11 100644 --- a/src/js/controller/write.js +++ b/src/js/controller/write.js @@ -432,7 +432,7 @@ define(function(require) { scope.$watch(model, function(value) { var width; - if (value.length < 12) { + if (!value || value.length < 12) { width = (14 * 8) + 'px'; } else { width = ((value.length + 2) * 8) + 'px'; @@ -484,7 +484,7 @@ define(function(require) { //scope: true, // optionally create a child scope link: function(scope, element, attrs) { element.on('click', function(e) { - if(e.target.nodeName === 'INPUT') { + if (e.target.nodeName === 'INPUT') { return; } @@ -532,7 +532,7 @@ define(function(require) { e.preventDefault(); // add next field only if current input is not empty - if(field[index].address) { + if (field[index].address) { // create new field input addInput(field, scope); // find next input and focus