kaimallea/isMobile

Can you add AMD support?

Closed this issue · 4 comments

Can you add AMD support?

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?

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;
}

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? 😃

Ok, I'll do it.