diff options
author | 2012-10-14 11:32:58 +0700 | |
---|---|---|
committer | 2012-10-14 11:32:58 +0700 | |
commit | 98f036ae01fe90ad9d5853918602b705fdd41f02 (patch) | |
tree | 4926b28a09a11376ce29fe0def9c432aab9ae7c2 /web/scripts3.js | |
parent | 4441c908f773f1b7c2b203fc6f47349408ae82c0 (diff) |
A lot of changes.
Diffstat (limited to 'web/scripts3.js')
-rw-r--r-- | web/scripts3.js | 24 |
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'); + } + }); + } }); |