slightly nicer

This commit is contained in:
Michael Foster 2013-09-15 11:28:32 +10:00
parent d74283640b
commit cf8656c44d

View File

@ -179,7 +179,7 @@ var show_quick_reply = function(){
$postForm.attr('id', 'quick-reply'); $postForm.attr('id', 'quick-reply');
$postForm.appendTo($('body')); $postForm.appendTo($('body')).hide();
// Synchronise body text with original post form // Synchronise body text with original post form
$('#body').bind('change input propertychange', function() { $('#body').bind('change input propertychange', function() {
@ -224,20 +224,23 @@ var show_quick_reply = function(){
$postForm.find('th').css('cursor', 'move'); $postForm.find('th').css('cursor', 'move');
} }
$postForm.show();
$origPostForm = $('form[name="post"]'); $origPostForm = $('form[name="post"]');
$(window).scroll(function() { $(window).ready(function() {
if ($(this).width() <= 800) $(window).scroll(function() {
return; if ($(this).width() <= 800)
if ($(this).scrollTop() < $origPostForm.offset().top + $origPostForm.height() - 100) return;
$postForm.fadeOut(100); if ($(this).scrollTop() < $origPostForm.offset().top + $origPostForm.height() - 100)
else $postForm.fadeOut(100);
$postForm.fadeIn(100); else
}).on('stylesheet', function() { $postForm.fadeIn(100);
do_css(); }).on('stylesheet', function() {
if ($('link#stylesheet').attr('href')) { do_css();
$('link#stylesheet')[0].onload = do_css; if ($('link#stylesheet').attr('href')) {
} $('link#stylesheet')[0].onload = do_css;
}
});
}); });
}; };