brendanheywood / moodle-local_cleanurls

Lets drag Moodle's url structure into this century...
36 stars 24 forks source link

Added check for null element to avoid TypeError: element is undefined… #103

Closed nyanginator closed 6 years ago

nyanginator commented 6 years ago

Added check for null element to avoid "TypeError: element is undefined" error (in Firefox) as discussed in https://github.com/brendanheywood/moodle-local_cleanurls/issues/97

brendanheywood commented 6 years ago

hhmm, thanks @nyanginator,

I've just had a deeper look and it seems like the issue is that this just isn't standard js, it should not be var element = event.srcElement; it should be var element = event.target;

https://developer.mozilla.org/en/docs/Web/API/Event/srcElement

https://developer.mozilla.org/en-US/docs/Web/API/Event/target

brendanheywood commented 6 years ago

thanks @nyanginator I've just pushed an alternate fixed for this so I'll close this pr, sorry for the misdirection