diff --git a/4chan_x.user.js b/4chan_x.user.js index 43d8b95db..3d09ff2f4 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -140,6 +140,7 @@ updater: { checkbox: { 'Scrolling': [false, 'Scroll updated posts into view. Only enabled at bottom of page.'], + 'Scroll BG': [false, 'Scroll background tabs'], 'Verbose': [true, 'Show countdown timer, new post count'], 'Auto Update': [true, 'Automatically fetch new posts'] }, @@ -1678,12 +1679,16 @@ init: function() { var checkbox, checked, dialog, html, input, name, title, _i, _len, _ref; if (conf['Scrolling']) { - $.bind(window, 'focus', (function() { - return updater.focus = true; - })); - $.bind(window, 'blur', (function() { - return updater.focus = false; - })); + if (conf['Scroll BG']) { + updater.focus = true; + } else { + $.bind(window, 'focus', (function() { + return updater.focus = true; + })); + $.bind(window, 'blur', (function() { + return updater.focus = false; + })); + } } html = "
-" + conf['Interval'] + "
"; checkbox = config.updater.checkbox; diff --git a/script.coffee b/script.coffee index bb9e9a59f..e86f7ab62 100644 --- a/script.coffee +++ b/script.coffee @@ -78,6 +78,7 @@ config = updater: checkbox: 'Scrolling': [false, 'Scroll updated posts into view. Only enabled at bottom of page.'] + 'Scroll BG': [false, 'Scroll background tabs'] 'Verbose': [true, 'Show countdown timer, new post count'] 'Auto Update': [true, 'Automatically fetch new posts'] 'Interval': 30 @@ -1376,8 +1377,11 @@ threadHiding = updater = init: -> if conf['Scrolling'] - $.bind window, 'focus', (-> updater.focus = true) - $.bind window, 'blur', (-> updater.focus = false) + if conf['Scroll BG'] + updater.focus = true + else + $.bind window, 'focus', (-> updater.focus = true) + $.bind window, 'blur', (-> updater.focus = false) html = "
-#{conf['Interval']}
" {checkbox} = config.updater for name of checkbox