diff --git a/4chan_x.user.js b/4chan_x.user.js index c82cefcbc..7fcf5d402 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -3775,7 +3775,8 @@ }, contract: function(thumb) { thumb.hidden = false; - return thumb.nextSibling.hidden = true; + thumb.nextSibling.hidden = true; + return $.removeClass(thumb.parentNode.parentNode.parentNode, 'image_expanded'); }, expand: function(thumb, url) { var a, img; @@ -3783,6 +3784,7 @@ return; } thumb.hidden = true; + $.addClass(thumb.parentNode.parentNode.parentNode, 'image_expanded'); if (img = thumb.nextSibling) { img.hidden = false; return; diff --git a/script.coffee b/script.coffee index 9c07b4f26..3bc084b72 100644 --- a/script.coffee +++ b/script.coffee @@ -2856,12 +2856,13 @@ ImageExpand = contract: (thumb) -> thumb.hidden = false thumb.nextSibling.hidden = true + $.removeClass thumb.parentNode.parentNode.parentNode, 'image_expanded' expand: (thumb, url) -> # Do not expand images of hidden/filtered replies, or already expanded pictures. return if $.x 'ancestor-or-self::*[@hidden]', thumb - thumb.hidden = true + $.addClass thumb.parentNode.parentNode.parentNode, 'image_expanded' if img = thumb.nextSibling # Expand already loaded picture img.hidden = false