From 1d38988f066206ccc8a147bb766647fa81b3bbcb Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Wed, 4 Jan 2012 00:23:50 +0100 Subject: [PATCH] Unfocus the QR when submitting. --- 4chan_x.user.js | 3 ++- script.coffee | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index 2d377cac8..7731b3be7 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -1228,7 +1228,8 @@ if ($.id('autohide').checked) { return $.addClass(qr.el, 'autohide'); } else { - return $.removeClass(qr.el, 'autohide'); + $.removeClass(qr.el, 'autohide'); + return d.activeElement.blur(); } }, error: function(err) { diff --git a/script.coffee b/script.coffee index 06b08bf91..3f517f105 100644 --- a/script.coffee +++ b/script.coffee @@ -896,6 +896,7 @@ qr = $.addClass qr.el, 'autohide' else $.removeClass qr.el, 'autohide' + d.activeElement.blur() error: (err) -> $('.error', qr.el).textContent = err @@ -1102,7 +1103,7 @@ textarea.field { submit: (e) -> e?.preventDefault() return if g.dead - if conf['Auto Hide QR'] + if conf['Auto Hide QR'] # and only one post (left) to submit $.id('autohide').checked = true qr.hide() qr.cleanError()