mirror of
https://github.com/vichan-devel/vichan.git
synced 2025-01-29 19:37:30 +01:00
Post hover: hide images when need to
This commit is contained in:
parent
0565e2119d
commit
5774d21632
@ -69,9 +69,11 @@ onready(function(){
|
|||||||
context: document.body,
|
context: document.body,
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
$(data).find('div.post.reply').each(function() {
|
$(data).find('div.post.reply').each(function() {
|
||||||
|
// Not 100% sure that this doesn't break shit:
|
||||||
|
$(document).trigger('new_post', this);
|
||||||
|
|
||||||
if($('#' + $(this).attr('id')).length == 0)
|
if($('#' + $(this).attr('id')).length == 0)
|
||||||
$('div.post:first').prepend($(this).css('display', 'none').addClass('hidden'));
|
$('div.post:first').prepend($(this).css('display', 'none').addClass('hidden'));
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$post = $('div.post#reply_' + id);
|
$post = $('div.post#reply_' + id);
|
||||||
|
@ -58,10 +58,10 @@ $(document).ready(function(){
|
|||||||
.click(function() {
|
.click(function() {
|
||||||
hide_images = !hide_images;
|
hide_images = !hide_images;
|
||||||
if (hide_images) {
|
if (hide_images) {
|
||||||
$('div > a > img').each(hideImage);
|
$('img.post-image').each(hideImage);
|
||||||
localStorage.hideimages = true;
|
localStorage.hideimages = true;
|
||||||
} else {
|
} else {
|
||||||
$('div > a > img').each(restoreImage);
|
$('img.post-image').each(restoreImage);
|
||||||
delete localStorage.hideimages;
|
delete localStorage.hideimages;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -71,7 +71,13 @@ $(document).ready(function(){
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (hide_images) {
|
if (hide_images) {
|
||||||
$('div > a > img').each(hideImage);
|
$('img.post-image').each(hideImage);
|
||||||
show_hide_hide_images_buttons();
|
show_hide_hide_images_buttons();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$(document).bind('new_post', function(e, post) {
|
||||||
|
if (hide_images) {
|
||||||
|
$(post).find('img.post-image').each(hideImage);
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user