Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

…roid
  • Loading branch information...
commit fe9b7586fb24c226163de4478d3a2b780173e394 1 parent 327ad2d
@pbakaus pbakaus authored
Showing with 11 additions and 1 deletion.
  1. +11 −1 src/viewporter.js
View
12 src/viewporter.js
@@ -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;
Please sign in to comment.
Something went wrong with that request. Please try again.