Show dark theme captcha if the document has the class dark-captcha.

This commit is contained in:
ccd0 2016-01-25 19:48:40 -08:00
parent d61dd5276f
commit 1dfa1df3b0

View File

@ -105,10 +105,11 @@ Captcha.v2 =
setupJS: ->
$.global ->
render = ->
{classList} = document.documentElement
container = document.querySelector '#qr .captcha-container'
container.dataset.widgetID = window.grecaptcha.render container,
sitekey: '<%= meta.recaptchaKey %>'
theme: if document.documentElement.classList.contains('tomorrow') then 'dark' else 'light'
theme: if classList.contains('tomorrow') or classList.contains('dark-captcha') then 'dark' else 'light'
callback: (response) ->
window.dispatchEvent new CustomEvent('captcha:success', {detail: response})
if window.grecaptcha