aboutsummaryrefslogtreecommitdiffstats
path: root/static/js
diff options
context:
space:
mode:
authorThibaut Horel <thibaut.horel@gmail.com>2015-04-07 19:34:45 -0400
committerThibaut Horel <thibaut.horel@gmail.com>2015-04-07 19:34:45 -0400
commit02db72ed0a6fc1d514e6323284df5e25bd8c6c6f (patch)
treebdb29ceefe98a58914f9123b40faab5289d77d7c /static/js
parentd26b5e0f3a0f79a6b8165004e19b65df836b1e08 (diff)
downloadfamille-flask-02db72ed0a6fc1d514e6323284df5e25bd8c6c6f.tar.gz
Adapt comment's textarea height to the content size
Diffstat (limited to 'static/js')
-rw-r--r--static/js/famille.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/static/js/famille.js b/static/js/famille.js
index 3bb9e51..9606d13 100644
--- a/static/js/famille.js
+++ b/static/js/famille.js
@@ -28,8 +28,12 @@ $(document).ready(function(){
$(".edit").click(function(e){
e.preventDefault();
- $(this).parents(".media-heading").siblings(".comment-content").hide();
- $(this).parents(".media-heading").siblings(".comment-source").show();
+ 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;
+ textarea.attr("rows", row_count);
+ heading.siblings(".comment-source").show();
});
$(".comment-source").submit(function(e){