Pageworks / papertrain

Papertrain: a Craft CMS 3 framework
http://download.papertrain.io
MIT License
5 stars 2 forks source link

IE 11 Load Event #209

Closed codewithkyle closed 4 years ago

codewithkyle commented 5 years ago

In the runtime.js file the el.addEventListener('load') event isn't firing. We should consider just resolving when we detect IE.

Possible Solution

if ('-ms-scroll-limit' in document.documentElement.style && '-ms-ime-align' in document.documentElement.style)
{
    setTimeout(()=>{
        count++;
        if (count === required)
        {
            resolve();
        }
    }, 150);
}
else
{
    el.addEventListener('load', () => {
        count++;
        if (count === required)
        {
            resolve();
        }
    });
}
codewithkyle commented 5 years ago

This issue is related to #205

codewithkyle commented 4 years ago

We're overthinking this. Just use document.createElement and append it to the <head> and listen for the load event.