aboutsummaryrefslogtreecommitdiff
path: root/web/scripts3.js
diff options
context:
space:
mode:
authorGravatar Ugnich Anton2012-01-28 15:23:08 +0700
committerGravatar Ugnich Anton2012-01-28 15:23:08 +0700
commit2acfbc4184eec216c2a394029962aa2905c6b0a2 (patch)
tree800489f62d09f05ee2c9a5c4409a9c831dd8e59e /web/scripts3.js
parentad61ffdbaf004dd3b33adf8f2780500069fa097b (diff)
Textarea autoresize update
Diffstat (limited to 'web/scripts3.js')
-rw-r--r--web/scripts3.js13
1 files changed, 12 insertions, 1 deletions
diff --git a/web/scripts3.js b/web/scripts3.js
index ec86d39e..12e0aeee 100644
--- a/web/scripts3.js
+++ b/web/scripts3.js
@@ -39,10 +39,21 @@ function showCommentForm(mid,rid) {
var c=$('#replies #'+rid+' .msg-comment');
c.wrap('<form action="/post" method="POST" enctype="multipart/form-data"/>');
c.before('<input type="hidden" name="mid" value="'+mid+'"/><input type="hidden" name="rid" value="'+rid+'"/>');
- c.append('<textarea name="body" rows="1" placeholder="Add a comment..." onkeypress="postformListener(this.form,event)"></textarea>');
+ c.append('<textarea name="body" rows="1" class="reply" placeholder="Add a comment..." onkeypress="postformListener(this.form,event)"></textarea>');
}
$('#replies #'+rid+' .msg-links').hide();
$('#replies #'+rid+' .msg-comment').show();
$('#replies #'+rid+' textarea')[0].focus();
+ $('#replies #'+rid+' textarea').autoResize({
+ extraSpace: 0,
+ minHeight: 1
+ });
return false;
}
+
+$(document).ready(function() {
+ $('textarea.reply').autoResize({
+ extraSpace: 0,
+ minHeight: 1
+ });
+});