don't shrink textarea on blur

This commit is contained in:
Martin Zimmermann 2013-09-12 12:28:53 +02:00
parent 10c65561ed
commit 1105e3e016
2 changed files with 4 additions and 6 deletions

View File

@ -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");

View File

@ -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()
});