From d827a6c3175072e303fbd9a702d9a7a2d6c97915 Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Thu, 21 Feb 2013 01:06:35 +0100 Subject: [PATCH] Inconsistency, fix for non-webkit browsers. --- 4chan_x.user.js | 6 +++--- src/config.coffee | 2 +- src/features.coffee | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index 78b34b6d3..230c0ff81 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -170,7 +170,7 @@ checkbox: { 'Beep': [false, 'Beep on new post to completely read thread.'], 'Auto Scroll': [false, 'Scroll updated posts into view. Only enabled at bottom of page.'], - 'Bottom scroll': [false, 'Always scroll to the bottom, not the first new post. Useful for event threads.'], + 'Bottom Scroll': [false, 'Always scroll to the bottom, not the first new post. Useful for event threads.'], 'Scroll BG': [false, 'Auto-scroll background tabs.'], 'Auto Update': [true, 'Automatically fetch new posts.'] }, @@ -5225,8 +5225,8 @@ scroll = Conf['Auto Scroll'] && ThreadUpdater.scrollBG() && ThreadUpdater.root.getBoundingClientRect().bottom - doc.clientHeight < 25; $.add(ThreadUpdater.root, nodes); if (scroll) { - if (Conf['Bottom scroll']) { - d.body.scrollTop = d.body.clientHeight; + if (Conf['Bottom Scroll']) { + ($.engine === 'webkit' ? d.body : doc).scrollTop = d.body.clientHeight; } else { nodes[0].scrollIntoView(); } diff --git a/src/config.coffee b/src/config.coffee index eb5d9eadb..b124c0cbe 100644 --- a/src/config.coffee +++ b/src/config.coffee @@ -163,7 +163,7 @@ Config = checkbox: 'Beep': [false, 'Beep on new post to completely read thread.'] 'Auto Scroll': [false, 'Scroll updated posts into view. Only enabled at bottom of page.'] - 'Bottom scroll': [false, 'Always scroll to the bottom, not the first new post. Useful for event threads.'] + 'Bottom Scroll': [false, 'Always scroll to the bottom, not the first new post. Useful for event threads.'] 'Scroll BG': [false, 'Auto-scroll background tabs.'] 'Auto Update': [true, 'Automatically fetch new posts.'] 'Interval': 30 diff --git a/src/features.coffee b/src/features.coffee index 515225da8..4fb277b9d 100644 --- a/src/features.coffee +++ b/src/features.coffee @@ -3531,8 +3531,8 @@ ThreadUpdater = ThreadUpdater.root.getBoundingClientRect().bottom - doc.clientHeight < 25 $.add ThreadUpdater.root, nodes if scroll - if Conf['Bottom scroll'] - d.body.scrollTop = d.body.clientHeight + if Conf['Bottom Scroll'] + (if $.engine is 'webkit' then d.body else doc).scrollTop = d.body.clientHeight else nodes[0].scrollIntoView()