From 396a1c2bd86dfb1b8553d9bff2fe6dfe78bb3f90 Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Thu, 16 Jun 2011 17:11:57 +0200 Subject: [PATCH] Fix persistent QR on non spoilable boards. --- 4chan_x.user.js | 6 ++++-- script.coffee | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index 9379da055..9bec01837 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -1192,10 +1192,12 @@ return ta.value += text; }, refresh: function(dialog) { - var f; + var f, _ref; $('textarea', dialog).value = ''; $('input[name=recaptcha_response_field]', dialog).value = ''; - $('input[name=spoiler]', dialog).checked = false; + if ((_ref = $('input[name=spoiler]', dialog)) != null) { + _ref.checked = false; + } f = $('input[type=file]', dialog).parentNode; return f.innerHTML = f.innerHTML; }, diff --git a/script.coffee b/script.coffee index 970a53ffa..f53d7ed93 100644 --- a/script.coffee +++ b/script.coffee @@ -936,7 +936,7 @@ qr = refresh: (dialog) -> $('textarea', dialog).value = '' $('input[name=recaptcha_response_field]', dialog).value = '' - $('input[name=spoiler]', dialog).checked = false + $('input[name=spoiler]', dialog)?.checked = false # XXX file.value = '' doesn't work in opera f = $('input[type=file]', dialog).parentNode f.innerHTML = f.innerHTML