Sticky Alerts (Unhandled Rejection (TypeError): Cannot read property 'insertBefore' of undefined)
timbogdanov opened this issue · 1 comments
timbogdanov commented
stephannv commented
Maybe your HTML is being loaded after halfmoon
initialization. halfmoon
fill stickyAlerts
on object initialization using:
{
...
stickyAlerts: document.getElementsByClassName("sticky-alerts")[0],
...
Maybe this can solve, but without a code sandbox to try it, I'm not sure. On line 22:
halfmoon.stickyAlerts = document.getElementsByClassName("sticky-alerts")[0]
halfmoon.initStickyAlert(...)