1
0
mirror of https://github.com/vichan-devel/vichan.git synced 2024-11-24 07:30:10 +01:00

dont show quick reply on tiny screens lol

This commit is contained in:
Michael Foster 2013-09-15 08:08:44 +10:00
parent 59aa89a84b
commit 260908025c

View File

@ -67,6 +67,11 @@ var show_quick_reply = function(){
#quick-reply td.submit {\ #quick-reply td.submit {\
width: 1%;\ width: 1%;\
}\ }\
@media screen and (max-width: 800px) {\
#quick-reply {\
display: none !important;\
}\
}\
</style>').appendTo($('head')); </style>').appendTo($('head'));
var $postForm = $('form[name="post"]').clone(); var $postForm = $('form[name="post"]').clone();
@ -157,6 +162,8 @@ var show_quick_reply = function(){
$origPostForm = $('form[name="post"]'); $origPostForm = $('form[name="post"]');
$(window).scroll(function() { $(window).scroll(function() {
if ($(this).width() <= 800)
return;
if ($(this).scrollTop() < $origPostForm.offset().top + $origPostForm.height() - 100) if ($(this).scrollTop() < $origPostForm.offset().top + $origPostForm.height() - 100)
$postForm.fadeOut(100); $postForm.fadeOut(100);
else else
@ -165,10 +172,11 @@ var show_quick_reply = function(){
}; };
$(window).on('cite', function(e, id, with_link) { $(window).on('cite', function(e, id, with_link) {
if ($(this).width() <= 800)
return;
show_quick_reply(); show_quick_reply();
$('#quick-reply textarea').focus(); $('#quick-reply textarea').focus();
if (with_link) { if (with_link) {
console.log(id, with_link);
setTimeout(function() { setTimeout(function() {
highlightReply(id); highlightReply(id);
$(window).scrollTop($('#' + id).offset().top); $(window).scrollTop($('#' + id).offset().top);