mirror of
https://github.com/a2nt/webpack-bootstrap-ui-kit.git
synced 2024-10-22 11:05:45 +02:00
IMPR: Add turnstile on AJAX
This commit is contained in:
parent
6eb9182448
commit
67eb797e9f
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@a2nt/ss-bootstrap-ui-webpack-boilerplate-react",
|
||||
"version": "5.0.9",
|
||||
"version": "5.1.0",
|
||||
"description": "This UI Kit allows you to build Bootstrap 5 webapp with some extra UI features. It's easy to extend and easy to convert HTML templates to CMS templates.",
|
||||
"author": "Tony Air <tony@twma.pro>",
|
||||
"license": "BSD-2-Clause",
|
||||
|
@ -49,5 +49,7 @@ export default ((W) => {
|
||||
}
|
||||
|
||||
W.addEventListener(`${Events.LODEDANDREADY}`, loadLazyImages)
|
||||
W.addEventListener(`${Events.AJAX}`, loadLazyImages)
|
||||
W.addEventListener(`${Events.AJAX}`, () => {
|
||||
setTimeout(loadLazyImages, 250)
|
||||
})
|
||||
})(window)
|
||||
|
14
src/js/ui/turnstile.js
Normal file
14
src/js/ui/turnstile.js
Normal file
@ -0,0 +1,14 @@
|
||||
import Events from '../_events'
|
||||
const NAME = 'uiTurnstile'
|
||||
|
||||
const init = () => {
|
||||
if (typeof window.turnstile === undefined) {
|
||||
return
|
||||
}
|
||||
|
||||
console.log(`${NAME}: init`)
|
||||
window.turnstile.render('.cf-turnstile')
|
||||
}
|
||||
|
||||
window.addEventListener(`${Events.LODEDANDREADY}`, init)
|
||||
window.addEventListener(`${Events.AJAX}`, init)
|
Loading…
Reference in New Issue
Block a user