aboutsummaryrefslogtreecommitdiff
path: root/web/scripts3.js
diff options
context:
space:
mode:
Diffstat (limited to 'web/scripts3.js')
-rw-r--r--web/scripts3.js24
1 files changed, 22 insertions, 2 deletions
diff --git a/web/scripts3.js b/web/scripts3.js
index bf3da76f..580546d2 100644
--- a/web/scripts3.js
+++ b/web/scripts3.js
@@ -39,7 +39,7 @@ 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" class="reply" placeholder="Add a comment..." onkeypress="postformListener(this.form,event)"></textarea><input type="submit" value="OK"/>');
+ c.append('<textarea name="body" rows="1" class="reply narrow" placeholder="Add a comment..." onkeypress="postformListener(this.form,event)"></textarea><input type="submit" value="OK"/>');
}
// $('#replies #'+rid+' .msg-links').hide();
$('#replies #'+rid+' .msg-comment').show();
@@ -63,8 +63,28 @@ function unfoldReply() {
}
$(document).ready(function() {
- $('textarea.reply').autoResize({
+ var tareply=$('textarea.reply');
+ tareply.autoResize({
extraSpace: 0,
minHeight: 1
});
+ tareply.click(function () {
+ $(this).addClass("narrow");
+ $(this).after('<input type="submit" value="OK"/>');
+ $(this).off('click');
+ });
+
+ if(!!$('.stickya').offset()) {
+ var stickyTop = $('.stickya').offset().top;
+ $(window).scroll(function() {
+ var windowTop = $(window).scrollTop();
+ if (stickyTop < windowTop) {
+ $('.stickya').css({
+ position:'fixed'
+ });
+ } else {
+ $('.stickya').css('position','absolute');
+ }
+ });
+ }
});