Can you add AMD support?
Closed this issue · 4 comments
vomchik commented
Can you add AMD support?
kaimallea commented
Hey, AMD support should be there -- https://github.com/kaimallea/isMobile/blob/master/isMobile.js#L91
Have you tried it? Is it not working for you?
vomchik commented
oh, i missed that. It is work.
But why you export your library to global scope in any case?
I think it's will better:
if (typeof module != 'undefined' && module.exports) {
module.exports = IM;
} else if (typeof define === 'function' && define.amd) {
define(IM);
} else {
global.isMobile = IM;
}
kaimallea commented
To be honest, I don't remember why I made it global in all cases. I remember there was a reason, but I don't remember it... so it must not have been that important. 😕
Pull request? 😃
vomchik commented
Ok, I'll do it.