mirror of
https://github.com/vichan-devel/vichan.git
synced 2025-01-19 01:24:05 +01:00
Don't show post when it's already in view. Highlight it instead.
This commit is contained in:
parent
a573960229
commit
1d7381554d
@ -20,7 +20,14 @@ $(document).ready(function(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
var post = $('div.post#reply_' + id);
|
var post = $('div.post#reply_' + id);
|
||||||
|
if(post.length == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
$(this).hover(function(e) {
|
$(this).hover(function(e) {
|
||||||
|
if($(window).scrollTop() <= post.offset().top + post.height()) {
|
||||||
|
// post is in view
|
||||||
|
post.attr('style', 'border-style: none dashed dashed none; background: ' + post.css('border-right-color'));
|
||||||
|
} else {
|
||||||
post.clone()
|
post.clone()
|
||||||
.attr('id', 'post-hover-' + id)
|
.attr('id', 'post-hover-' + id)
|
||||||
.addClass('post-hover')
|
.addClass('post-hover')
|
||||||
@ -30,7 +37,9 @@ $(document).ready(function(){
|
|||||||
.css('border-style', 'solid')
|
.css('border-style', 'solid')
|
||||||
.css('box-shadow', '1px 1px 1px #999')
|
.css('box-shadow', '1px 1px 1px #999')
|
||||||
.insertAfter($(this).parent());
|
.insertAfter($(this).parent());
|
||||||
|
}
|
||||||
}, function() {
|
}, function() {
|
||||||
|
post.attr('style', '');
|
||||||
$('.post-hover').remove();
|
$('.post-hover').remove();
|
||||||
}).mousemove(function(e) {
|
}).mousemove(function(e) {
|
||||||
$('#post-hover-' + id)
|
$('#post-hover-' + id)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user