Show dark theme captcha if the document has the class dark-captcha.
This commit is contained in:
parent
d61dd5276f
commit
1dfa1df3b0
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user