From 83b52f1bb52ad14f07f6cbb7b153dca38b6c76e5 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Thu, 1 Nov 2018 23:46:28 -0700 Subject: [PATCH] Add option `Expand thread only` in `Image Expansion` menu; makes expanding all images when in index only operate within current thread. --- src/Images/ImageExpand.coffee | 8 +++++--- src/config/Config.coffee | 4 ++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/Images/ImageExpand.coffee b/src/Images/ImageExpand.coffee index 7aa7f97a0..7ea4b8ac5 100644 --- a/src/Images/ImageExpand.coffee +++ b/src/Images/ImageExpand.coffee @@ -53,13 +53,15 @@ ImageExpand = toggleAll: -> $.event 'CloseMenu' + threadRoot = Nav.getThread() toggle = (post) -> {file} = post return unless file and (file.isImage or file.isVideo) and doc.contains post.nodes.root if ImageExpand.on and - (!Conf['Expand spoilers'] and file.isSpoiler or - !Conf['Expand videos'] and file.isVideo or - Conf['Expand from here'] and Header.getTopOf(file.thumb) < 0) + (!Conf['Expand spoilers'] and file.isSpoiler or + !Conf['Expand videos'] and file.isVideo or + Conf['Expand from here'] and Header.getTopOf(file.thumb) < 0 or + Conf['Expand thread only'] and g.VIEW is 'index' and !threadRoot?.contains(file.thumb)) return $.queueTask func, post diff --git a/src/config/Config.coffee b/src/config/Config.coffee index c968ba40d..25083eb0c 100644 --- a/src/config/Config.coffee +++ b/src/config/Config.coffee @@ -620,6 +620,10 @@ Config = false 'Expand all images only from current position to thread end.' ] + 'Expand thread only': [ + false + 'In index, expand all images only within the current thread.' + ] 'Advance on contract': [ false 'Advance to next post when contracting an expanded image.'