aboutsummaryrefslogtreecommitdiffstats
path: root/static
diff options
context:
space:
mode:
authorThibaut Horel <thibaut.horel@gmail.com>2015-04-07 20:52:24 -0400
committerThibaut Horel <thibaut.horel@gmail.com>2015-04-07 20:52:24 -0400
commit8b0582d44150a5840a03adec8ac87663020564a4 (patch)
tree4eebba513df86c31812b23f0cd3f557ca9a61c89 /static
parentbae07cdbc5bfe1730d8bcf426ac0f0ebf1c327fe (diff)
downloadfamille-flask-8b0582d44150a5840a03adec8ac87663020564a4.tar.gz
Better computation of the required height for the textarea
Diffstat (limited to 'static')
-rw-r--r--static/js/famille.js3
1 files changed, 1 insertions, 2 deletions
diff --git a/static/js/famille.js b/static/js/famille.js
index 515afa2..cc53120 100644
--- a/static/js/famille.js
+++ b/static/js/famille.js
@@ -31,9 +31,8 @@ $(document).ready(function(){
var heading = $(this).parents(".media-heading");
heading.siblings(".comment-content").hide();
var textarea = heading.siblings(".comment-source").find("textarea");
- var row_count = textarea.val().split("\n").length + 1;
- textarea.attr("rows", row_count);
heading.siblings(".comment-source").show();
+ textarea.css("height", textarea[0].scrollHeight + 2);
});
$(".comment-source").submit(function(e){