Permalink
Browse files

added a flag to optionally be able to disable detection on legacy And…

…roid
  • Loading branch information...
pbakaus committed Feb 15, 2013
1 parent 327ad2d commit fe9b7586fb24c226163de4478d3a2b780173e394
Showing with 11 additions and 1 deletion.
  1. +11 −1 src/viewporter.js
View
@@ -17,9 +17,16 @@ var viewporter;
// options
forceDetection: false,
+ disableLegacyAndroid: true,
+
// constants
ACTIVE: (function() {
+ // it's best not do to anything to very weak devices running Android 2.x
+ if(viewporter.disableLegacyAndroid && (/android 2/i).test(navigator.userAgent)) {
+ return false;
+ }
+
// iPad's don't allow you to scroll away the UI of the browser
if((/ipad/i).test(navigator.userAgent)) {
return false;
@@ -37,7 +44,7 @@ var viewporter;
return false;
- })(),
+ }),
READY: false,
@@ -77,6 +84,9 @@ var viewporter;
};
+ // execute the ACTIVE flag
+ viewporter.ACTIVE = viewporter.ACTIVE();
+
// if we are on Desktop, no need to go further
if (!viewporter.ACTIVE) {
return;

0 comments on commit fe9b758

Please sign in to comment.