Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

isMobile method "for" issue #28

Closed
ypanshin opened this issue Jan 5, 2015 · 1 comment
Closed

isMobile method "for" issue #28

ypanshin opened this issue Jan 5, 2015 · 1 comment

Comments

@ypanshin
Copy link

ypanshin commented Jan 5, 2015

In my code I am working with extensions methods on Array prototype. And I have a issue with method "isMobile". The method has "for" that run on a collection "settings.nativeOnDevice" without checking if the collection has has own a property. Without the check the method throw exception when try to accept to extension method on the collection.
Could you please add validation to the method if the collection has own the property or to change it to regular for with index ?

Example:

isMobile: function () {
   var ua = navigator.userAgent || navigator.vendor || window.opera;
   for (var i in settings.nativeOnDevice)
        if (settings.nativeOnDevice.hasOwnProperty(i))
           if (ua.toLowerCase().indexOf(settings.nativeOnDevice[i].toLowerCase()) > 0)
               return settings.nativeOnDevice[i];
   return false
}

Thanks

@HemantNegi
Copy link
Owner

Will be fixed in next version
cheers!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants