From 302fd108157036a646717b9f5e5592e248ef0012 Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Tue, 7 Feb 2012 17:45:57 +0100 Subject: [PATCH] Fix overflow reset when closing the options with the keybind. Fix typo. --- 4chan_x.user.js | 13 +++++++------ script.coffee | 12 +++++++----- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index c42d13b4a..cf6c00458 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -890,7 +890,7 @@ break; case conf.close: if (o = $.id('overlay')) { - $.rm(o); + options.close.call(o); } else if (qr.el) { qr.close(); } @@ -2043,7 +2043,7 @@ \
\
Keybinds are disabled.
\ -
Allowed keys: Ctrl, Alt, a-z, A-Z, 0-1, Up, Down, Right, Left.
\ +
Allowed keys: Ctrl, Alt, a-z, A-Z, 0-9, Up, Down, Right, Left.
\ \ \
ActionsKeybinds
\ @@ -2116,10 +2116,7 @@ overlay = $.el('div', { id: 'overlay' }); - $.on(overlay, 'click', function() { - d.body.style.removeProperty('overflow'); - return $.rm(overlay); - }); + $.on(overlay, 'click', options.close); $.on(dialog, 'click', function(e) { return e.stopPropagation(); }); @@ -2130,6 +2127,10 @@ options.time.call(time); return options.favicon.call(favicon); }, + close: function() { + $.rm(this); + return d.body.style.removeProperty('overflow'); + }, clearHidden: function() { $["delete"]("hiddenReplies/" + g.BOARD + "/"); $["delete"]("hiddenThreads/" + g.BOARD + "/"); diff --git a/script.coffee b/script.coffee index 130757984..05150375e 100644 --- a/script.coffee +++ b/script.coffee @@ -658,7 +658,7 @@ keybinds = options.dialog() unless $.id 'overlay' when conf.close if o = $.id 'overlay' - $.rm o + options.close.call o else if qr.el qr.close() when conf.spoiler @@ -1597,7 +1597,7 @@ options =
Keybinds are disabled.
-
Allowed keys: Ctrl, Alt, a-z, A-Z, 0-1, Up, Down, Right, Left.
+
Allowed keys: Ctrl, Alt, a-z, A-Z, 0-9, Up, Down, Right, Left.
ActionsKeybinds
@@ -1660,9 +1660,7 @@ options = indicators[@name].hidden = @checked overlay = $.el 'div', id: 'overlay' - $.on overlay, 'click', -> - d.body.style.removeProperty 'overflow' - $.rm overlay + $.on overlay, 'click', options.close $.on dialog, 'click', (e) -> e.stopPropagation() $.add overlay, dialog $.add d.body, overlay @@ -1672,6 +1670,10 @@ options = options.time.call time options.favicon.call favicon + close: -> + $.rm this + d.body.style.removeProperty 'overflow' + clearHidden: -> #'hidden' might be misleading; it's the number of IDs we're *looking* for, # not the number of posts actually hidden on the page.