Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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

…roid
  • Loading branch information...
commit fe9b7586fb24c226163de4478d3a2b780173e394 1 parent 327ad2d
Paul Bakaus pbakaus authored

Showing 1 changed file with 11 additions and 1 deletion. Show diff stats Hide diff stats

  1. +11 1 src/viewporter.js
12 src/viewporter.js
@@ -17,9 +17,16 @@ var viewporter;
17 17 // options
18 18 forceDetection: false,
19 19
  20 + disableLegacyAndroid: true,
  21 +
20 22 // constants
21 23 ACTIVE: (function() {
22 24
  25 + // it's best not do to anything to very weak devices running Android 2.x
  26 + if(viewporter.disableLegacyAndroid && (/android 2/i).test(navigator.userAgent)) {
  27 + return false;
  28 + }
  29 +
23 30 // iPad's don't allow you to scroll away the UI of the browser
24 31 if((/ipad/i).test(navigator.userAgent)) {
25 32 return false;
@@ -37,7 +44,7 @@ var viewporter;
37 44
38 45 return false;
39 46
40   - })(),
  47 + }),
41 48
42 49 READY: false,
43 50
@@ -77,6 +84,9 @@ var viewporter;
77 84
78 85 };
79 86
  87 + // execute the ACTIVE flag
  88 + viewporter.ACTIVE = viewporter.ACTIVE();
  89 +
80 90 // if we are on Desktop, no need to go further
81 91 if (!viewporter.ACTIVE) {
82 92 return;

0 comments on commit fe9b758

Please sign in to comment.
Something went wrong with that request. Please try again.