From 1105e3e0160d38914c91dcf42f134ddaf549231d Mon Sep 17 00:00:00 2001 From: Martin Zimmermann Date: Thu, 12 Sep 2013 12:28:53 +0200 Subject: [PATCH] don't shrink textarea on blur --- isso/js/app/forms.js | 6 +----- isso/js/app/isso.js | 4 +++- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/isso/js/app/forms.js b/isso/js/app/forms.js index 5b48c88..9f37565 100644 --- a/isso/js/app/forms.js +++ b/isso/js/app/forms.js @@ -15,13 +15,9 @@ define(["lib/HTML"], function(HTML) { textarea.value = defaults.text || ""; textarea.placeholder = "Kommentar hier eintippen (andere Felder sind optional)" textarea.onfocus = function() { - textarea.rows = 10; + textarea.rows = 8; // scrollIntoView enhancement }; - textarea.onblur = function() { setTimeout(function() { - if (textarea.value == "" && document.activeElement != textarea) { - textarea.rows = 2 - }}, 500)}; form.add("input[type=submit]").value = "Kommentar hinzufügen"; form.add("span"); diff --git a/isso/js/app/isso.js b/isso/js/app/isso.js index cf2aa20..48c2511 100644 --- a/isso/js/app/isso.js +++ b/isso/js/app/isso.js @@ -179,7 +179,9 @@ define(["lib/q", "lib/HTML", "helper/utils", "helper/identicons", "./api", "./fo rootmsgbox.query("[name=email]").value = ""; rootmsgbox.query("[name=website]").value = ""; rootmsgbox.query("textarea").value = ""; - insert(rv); + rootmsgbox.query("textarea").rows = 2; + rootmsgbox.query("textarea").blur(); + insert(rv, true); }) event.preventDefault() });