aboutsummaryrefslogtreecommitdiff
path: root/web/scripts3.js
diff options
context:
space:
mode:
Diffstat (limited to 'web/scripts3.js')
-rw-r--r--web/scripts3.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/web/scripts3.js b/web/scripts3.js
index 723e3d76..8445ee19 100644
--- a/web/scripts3.js
+++ b/web/scripts3.js
@@ -443,6 +443,19 @@ function showCommentForm(mid,rid) {
return false;
}
+function showCommentFooter(e) {
+ var a=$(e).closest("article");
+ if(a.find("footer.comm").length==0) {
+ a.append('<form action="/post" method="POST" enctype="multipart/form-data"><input type="hidden" name="mid" value="'+a.data('mid')+'"/><footer class="comm"><div class="ta-wrapper"><textarea name="body" rows="1" class="reply narrow" placeholder="Написать комментарий..." onkeypress="postformListener(this.form,event)"></textarea><div class="attach-photo" onclick="attachCommentPhoto(this)"/></div><input type="submit" value="OK"/></footer></form>');
+ a.find('textarea').autoResize({
+ extraSpace: 0,
+ minHeight: 1
+ });
+ }
+ a.find('textarea')[0].focus();
+ return false;
+}
+
function attachCommentPhoto(div) {
if($(div).children().length===0) {
var inp=$('<input type="file" name="attach" accept="image/jpeg,image/png" style="visibility: hidden"/>');