mirror of
https://github.com/django-components/django-components.git
synced 2025-08-31 19:27:19 +00:00
🐛Prevent potential null elements
because {% component_js_dependencies %} loads all the components regardless
This commit is contained in:
parent
f5c3f64c86
commit
bb256f2ec8
2 changed files with 9 additions and 5 deletions
|
@ -1,3 +1,5 @@
|
|||
(function(){
|
||||
document.querySelector(".calendar-component").onclick = function(){alert("Clicked calendar!")}
|
||||
if (document.querySelector(".calendar-component")) {
|
||||
document.querySelector(".calendar-component").onclick = function(){ alert("Clicked calendar!"); };
|
||||
}
|
||||
})()
|
Loading…
Add table
Add a link
Reference in a new issue