init
This commit is contained in:
12
staticfiles/account/js/onload.js
Normal file
12
staticfiles/account/js/onload.js
Normal file
@ -0,0 +1,12 @@
|
||||
(function () {
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
Array.from(document.querySelectorAll('script[data-allauth-onload]')).forEach(scriptElt => {
|
||||
const funcRef = scriptElt.dataset.allauthOnload
|
||||
if (typeof funcRef === 'string' && funcRef.startsWith('allauth.')) {
|
||||
const funcArg = JSON.parse(scriptElt.textContent)
|
||||
const func = funcRef.split('.').reduce((acc, part) => acc && acc[part], window)
|
||||
func(funcArg)
|
||||
}
|
||||
})
|
||||
})
|
||||
})()
|
Reference in New Issue
Block a user