summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--js/post-hover.js4
-rw-r--r--js/toggle-images.js12
2 files changed, 12 insertions, 4 deletions
diff --git a/js/post-hover.js b/js/post-hover.js
index 48f0ed96..f4dc9909 100644
--- a/js/post-hover.js
+++ b/js/post-hover.js
@@ -69,9 +69,11 @@ onready(function(){
context: document.body,
success: function(data) {
$(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)
$('div.post:first').prepend($(this).css('display', 'none').addClass('hidden'));
-
});
$post = $('div.post#reply_' + id);
diff --git a/js/toggle-images.js b/js/toggle-images.js
index de1d47b3..9927031a 100644
--- a/js/toggle-images.js
+++ b/js/toggle-images.js
@@ -58,10 +58,10 @@ $(document).ready(function(){
.click(function() {
hide_images = !hide_images;
if (hide_images) {
- $('div > a > img').each(hideImage);
+ $('img.post-image').each(hideImage);
localStorage.hideimages = true;
} else {
- $('div > a > img').each(restoreImage);
+ $('img.post-image').each(restoreImage);
delete localStorage.hideimages;
}
@@ -71,7 +71,13 @@ $(document).ready(function(){
});
if (hide_images) {
- $('div > a > img').each(hideImage);
+ $('img.post-image').each(hideImage);
show_hide_hide_images_buttons();
}
+
+ $(document).bind('new_post', function(e, post) {
+ if (hide_images) {
+ $(post).find('img.post-image').each(hideImage);
+ }
+ });
});