don't directly set style.visibility

This commit is contained in:
James Campos 2010-10-08 16:44:36 -07:00
parent 4a0c13a8c1
commit 7525b505aa
2 changed files with 8 additions and 10 deletions

View File

@ -444,7 +444,7 @@ submit = (e) ->
alert 'You forgot to type in the verification.' alert 'You forgot to type in the verification.'
recaptcha.focus() recaptcha.focus()
else else
@style.visibility = 'collapse' $('#qr input[title=autohide]:not(:checked)')?.click()
autohide = -> autohide = ->
@ -503,7 +503,10 @@ quickReply = (e) ->
} }
clone.appendChild(input) clone.appendChild(input)
qr.appendChild(clone) qr.appendChild(clone)
document.body.appendChild(qr) inBefore(document.body.firstChild, qr)
#XXX - put qr first in body, so `Recaptcha.reload()`,
# when using document.getElementById, sees and focuses this
# instead of the original.
if e if e
e.preventDefault() e.preventDefault()
@ -739,10 +742,6 @@ if getConfig('Quick Reply')
quote.addEventListener('click', quickReply, true) quote.addEventListener('click', quickReply, true)
) )
#hack - nuke the original recaptcha's id so it doesn't grab focus
# when reloading
$('form[name=post] input[name=recaptcha_response_field]').id = ''
if getConfig('Quick Report') if getConfig('Quick Report')
callbacks.push((root) -> callbacks.push((root) ->

View File

@ -470,7 +470,7 @@
} }
}; };
submit = function(e) { submit = function(e) {
var recaptcha, span; var _ref2, _ref3, recaptcha, span;
if (span = this.nextSibling) { if (span = this.nextSibling) {
remove(span); remove(span);
} }
@ -485,7 +485,7 @@
alert('You forgot to type in the verification.'); alert('You forgot to type in the verification.');
return recaptcha.focus(); return recaptcha.focus();
} else { } else {
return (this.style.visibility = 'collapse'); return (typeof (_ref3 = ((_ref2 = $('#qr input[title=autohide]:not(:checked)')))) === "undefined" || _ref3 === null) ? undefined : _ref3.click();
} }
}; };
autohide = function() { autohide = function() {
@ -545,7 +545,7 @@
clone.appendChild(input); clone.appendChild(input);
} }
qr.appendChild(clone); qr.appendChild(clone);
document.body.appendChild(qr); inBefore(document.body.firstChild, qr);
} }
if (e) { if (e) {
e.preventDefault(); e.preventDefault();
@ -822,7 +822,6 @@
} }
return _result; return _result;
}); });
$('form[name=post] input[name=recaptcha_response_field]').id = '';
} }
if (getConfig('Quick Report')) { if (getConfig('Quick Report')) {
callbacks.push(function(root) { callbacks.push(function(root) {