Skip to content

Commit

Permalink
added a flag to optionally be able to disable detection on legacy And…
Browse files Browse the repository at this point in the history
…roid
  • Loading branch information
pbakaus committed Feb 15, 2013
1 parent 327ad2d commit fe9b758
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/viewporter.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -17,9 +17,16 @@ var viewporter;
// options // options
forceDetection: false, forceDetection: false,


disableLegacyAndroid: true,

// constants // constants
ACTIVE: (function() { 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 // iPad's don't allow you to scroll away the UI of the browser
if((/ipad/i).test(navigator.userAgent)) { if((/ipad/i).test(navigator.userAgent)) {
return false; return false;
Expand All @@ -37,7 +44,7 @@ var viewporter;


return false; return false;


})(), }),


READY: false, READY: false,


Expand Down Expand Up @@ -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 we are on Desktop, no need to go further
if (!viewporter.ACTIVE) { if (!viewporter.ACTIVE) {
return; return;
Expand Down

0 comments on commit fe9b758

Please sign in to comment.