summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorMichael Foster <savetheinternet@tinyboard.org>2013-09-15 11:28:32 +1000
committerMichael Foster <savetheinternet@tinyboard.org>2013-09-15 11:28:32 +1000
commitcf8656c44ded3dc70af7ed0584653e90c6ddab5f (patch)
tree3abc6d610a8bdf890e84b9a3aea26f75d00ba626 /js
parentd74283640b1134f8389fe0f4c6cf44f9eb643dc0 (diff)
slightly nicer
Diffstat (limited to 'js')
-rw-r--r--js/quick-reply.js29
1 files changed, 16 insertions, 13 deletions
diff --git a/js/quick-reply.js b/js/quick-reply.js
index c17897aa..3112ac2a 100644
--- a/js/quick-reply.js
+++ b/js/quick-reply.js
@@ -179,7 +179,7 @@ var show_quick_reply = function(){
$postForm.attr('id', 'quick-reply');
- $postForm.appendTo($('body'));
+ $postForm.appendTo($('body')).hide();
// Synchronise body text with original post form
$('#body').bind('change input propertychange', function() {
@@ -224,20 +224,23 @@ var show_quick_reply = function(){
$postForm.find('th').css('cursor', 'move');
}
+ $postForm.show();
$origPostForm = $('form[name="post"]');
- $(window).scroll(function() {
- if ($(this).width() <= 800)
- return;
- if ($(this).scrollTop() < $origPostForm.offset().top + $origPostForm.height() - 100)
- $postForm.fadeOut(100);
- else
- $postForm.fadeIn(100);
- }).on('stylesheet', function() {
- do_css();
- if ($('link#stylesheet').attr('href')) {
- $('link#stylesheet')[0].onload = do_css;
- }
+ $(window).ready(function() {
+ $(window).scroll(function() {
+ if ($(this).width() <= 800)
+ return;
+ if ($(this).scrollTop() < $origPostForm.offset().top + $origPostForm.height() - 100)
+ $postForm.fadeOut(100);
+ else
+ $postForm.fadeIn(100);
+ }).on('stylesheet', function() {
+ do_css();
+ if ($('link#stylesheet').attr('href')) {
+ $('link#stylesheet')[0].onload = do_css;
+ }
+ });
});
};