From e269182e8d02cbb5a74c7aeda17aeaa9ecd39f74 Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Sun, 5 Feb 2012 14:17:19 +0100 Subject: [PATCH] Prevent the page from being scrolled with opened options. --- 4chan_x.user.js | 2 ++ script.coffee | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index 8f0152165..b1334e93f 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -2113,6 +2113,7 @@ id: 'overlay' }); $.on(overlay, 'click', function() { + d.body.style.removeProperty('overflow'); return $.rm(overlay); }); $.on(dialog, 'click', function(e) { @@ -2120,6 +2121,7 @@ }); $.add(overlay, dialog); $.add(d.body, overlay); + d.body.style.setProperty('overflow', 'hidden', 'important'); options.backlink.call(back); options.time.call(time); return options.favicon.call(favicon); diff --git a/script.coffee b/script.coffee index 329c28c48..4ebedb04c 100644 --- a/script.coffee +++ b/script.coffee @@ -1647,10 +1647,13 @@ options = indicators[@name].hidden = @checked overlay = $.el 'div', id: 'overlay' - $.on overlay, 'click', -> $.rm overlay + $.on overlay, 'click', -> + d.body.style.removeProperty 'overflow' + $.rm overlay $.on dialog, 'click', (e) -> e.stopPropagation() $.add overlay, dialog $.add d.body, overlay + d.body.style.setProperty 'overflow', 'hidden', 'important' options.backlink.call back options.time.call time