ten1seven / what-input

A global utility for tracking the current input method (mouse/pointer, keyboard or touch).
https://ten1seven.github.io/what-input
MIT License
1.36k stars 77 forks source link

Add DOMContentLoaded EventListener #25

Closed meibegger closed 8 years ago

meibegger commented 8 years ago

I stumbled across a situation, where i need to include the script in the head of the page. So document.body is not available. Adding an EventListener in case document.body is not available solved this issue for me. What do you think?

ten1seven commented 8 years ago

Yea, that's probably a good call. Take a look at this PR and let me know what you think. It's very similar but does away with the init function.

ten1seven commented 8 years ago

I'm going to close out this PR since I implemented is here.

meibegger commented 8 years ago

sure!