200520 New reply layout and Longhorn theme
This commit is contained in:
@ -121,6 +121,70 @@ $('body').on('click', '.replies', function(e) {
|
||||
});
|
||||
});
|
||||
|
||||
$.fn.isOnScreen = function(){
|
||||
|
||||
var win = $(window);
|
||||
|
||||
var viewport = {
|
||||
top : win.scrollTop(),
|
||||
left : win.scrollLeft()
|
||||
};
|
||||
viewport.right = viewport.left + win.width();
|
||||
viewport.bottom = viewport.top + win.height();
|
||||
|
||||
var bounds = this.offset();
|
||||
bounds.right = bounds.left + this.outerWidth();
|
||||
bounds.bottom = bounds.top + this.outerHeight();
|
||||
|
||||
return (!(viewport.right < bounds.left || viewport.left > bounds.right || viewport.bottom < bounds.top || viewport.top > bounds.bottom));
|
||||
|
||||
};
|
||||
/*
|
||||
$('body').on('click', '.postbody:not(a)', function(e) {
|
||||
e.preventDefault;
|
||||
$(".reply").remove();
|
||||
$(".element").removeClass("element_pad");
|
||||
$(this).closest(".element").addClass("element_pad");
|
||||
//$('.replies_container').html('');
|
||||
var id = $(this).closest(".post").attr('id');
|
||||
if($('#' + id+'.replies_container').find('.reply').length < 1){
|
||||
$('#' + id+'.replies_container').html("<p><img src='img/loading.gif'></p>");
|
||||
}
|
||||
$.get("action.php?a=true&replies=" + id, function(data) {
|
||||
$('#' + id+'.replies_container').html(data);
|
||||
$('#' + id+'.replies_container').delay(800).fadeIn(400);
|
||||
$('#a' + id).html('');
|
||||
$('#' + id+".replies_container .ancestor").appendTo('#a' + id);
|
||||
});
|
||||
});
|
||||
*/
|
||||
/*
|
||||
$('body').on('click', '.postbody:not(a)', function(e) {
|
||||
e.preventDefault;
|
||||
$(".reply").remove();
|
||||
$(".element").removeClass("element_pad");
|
||||
$(this).closest(".element").addClass("element_pad");
|
||||
var id = $(this).closest(".post").attr('id');
|
||||
var offset = $('#'+id+' .postHeader').offset().top + 200;
|
||||
if($('#' + id+'.replies_container').find('.reply').length < 1){
|
||||
$('#' + id+'.replies_container').html("<p><img src='img/loading.gif'></p>");
|
||||
}
|
||||
$.get("action.php?a=true&replies=" + id, function(data) {
|
||||
$('#' + id+'.replies_container').html(data);
|
||||
$('#' + id+'.replies_container').delay(800).fadeIn(400);
|
||||
$('#a' + id).html('');
|
||||
$.when($('#' + id+".replies_container .ancestor").appendTo('#a' + id)).then(function() {
|
||||
if ($('#'+id+'.post_buttons').isOnScreen() == false) {
|
||||
$('html, body').animate({
|
||||
scrollTop: offset
|
||||
}, 1000);
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
*/
|
||||
|
||||
$('body').on('click', '.ldr:not(.tlicon)', function(e) {
|
||||
$('.tlicon').each(function(a){
|
||||
$( this ).removeClass('tiselected')
|
||||
@ -497,4 +561,4 @@ function timeSince(date) {
|
||||
return " just now";
|
||||
}
|
||||
return Math.floor(seconds) + " seconds";
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user