From 0912bfb98df15693c0b319eaf30a172885b310c1 Mon Sep 17 00:00:00 2001 From: Zixaphir Date: Thu, 17 Jul 2014 19:19:48 -0700 Subject: [PATCH] Implement #673 Conflicts: builds/appchan-x.user.js builds/crx/script.js src/General/Config.coffee src/Images/Gallery.coffee --- src/General/Config.coffee | 6 ++++-- src/Images/Gallery.coffee | 7 +++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/General/Config.coffee b/src/General/Config.coffee index 8a92f78e3..e06370ac8 100755 --- a/src/General/Config.coffee +++ b/src/General/Config.coffee @@ -448,13 +448,15 @@ Config = 'Hide Thumbnails': [ false ] - # Fit Width =/= Fit width - 'Fit Width': [ + 'Fit Width': [ # 'Fit width' (lowercase W) belongs to Image Expansion. Engine limitations, heh. true ] 'Fit Height': [ true ] + 'Scroll to Post': [ + true + ] 'Slide Delay': [ 5.0 ] diff --git a/src/Images/Gallery.coffee b/src/Images/Gallery.coffee index 56f341214..bbdccbbd3 100644 --- a/src/Images/Gallery.coffee +++ b/src/Images/Gallery.coffee @@ -165,6 +165,13 @@ Gallery = # Center selected thumbnail nodes.thumbs.scrollTop = @offsetTop + @offsetHeight/2 - nodes.thumbs.clientHeight/2 + # Scroll to post + try + if Conf['Scroll to Post'] and post = (post = g.posts[file.dataset.post])?.nodes.root + Header.scrollTo post + catch err + console.log err + image: (e) -> e.preventDefault() e.stopPropagation()