From adda6e19de3d5acb420ed4757869b20d2ca15f15 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Sun, 27 Jul 2014 09:54:17 -0700 Subject: [PATCH] fix my "optimization" --- src/Images/ImageExpand.coffee | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Images/ImageExpand.coffee b/src/Images/ImageExpand.coffee index 6ecd4cca5..7c16d50c0 100755 --- a/src/Images/ImageExpand.coffee +++ b/src/Images/ImageExpand.coffee @@ -177,16 +177,15 @@ ImageExpand = file.isExpanded = true delete file.isExpanding - {bottom, height} = file.fullImage.getBoundingClientRect() - # Scroll to keep our place in the thread when images are expanded above us. if oldBottom? and oldBottom <= 0 - window.scrollBy 0, bottom - oldBottom + window.scrollBy 0, post.nodes.root.getBoundingClientRect().bottom - oldBottom # Scroll to display full image. if file.scrollIntoView delete file.scrollIntoView imageBottom = Header.getBottomOf file.fullImage + {height} = file.fullImage.getBoundingClientRect() if imageBottom + height >= 0 and imageBottom < 0 window.scrollBy 0, Math.min(-imageBottom, Header.getTopOf file.fullImage)