diff --git a/4chan_x.user.js b/4chan_x.user.js index 5fea61f00..8687d9730 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -1426,6 +1426,9 @@ }, submit: function(e) { var id, msg, op; + if (this.id !== 'qr_form') { + return; + } if (msg = qr.postInvalid()) { if (typeof e.preventDefault === "function") { e.preventDefault(); @@ -1447,9 +1450,6 @@ } } } - if (this.id !== 'qr_form') { - return; - } if (!e) { this.submit(); } diff --git a/script.coffee b/script.coffee index 990521aee..0fe5c5c68 100644 --- a/script.coffee +++ b/script.coffee @@ -1176,6 +1176,8 @@ qr = $.replace oldFile, newFile submit: (e) -> + return unless @id is 'qr_form' + #XXX `e` won't exist if we're here from `qr.submit.call form`. if msg = qr.postInvalid() e.preventDefault?() @@ -1193,8 +1195,6 @@ qr = if $('img.favicon', op).src is Favicon.empty watcher.watch op, id - return unless @id is 'qr_form' - if !e then @submit() $('#error', qr.el).textContent = '' $('#autohide', qr.el).checked = true if conf['Auto Hide QR']