Skip to content

Commit

Permalink
if has touchevent, set devicepixelratio to 0.5
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromeetienne committed Mar 3, 2013
1 parent 09cd4ef commit 2e94d2b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions plugins/boilerplate/tquery.world.boilerplate.js
Expand Up @@ -118,6 +118,13 @@ tQuery.World.registerInstance('addBoilerplate', function(opts){
this.removeBoilerplate();
});


// if on mobile, set devicePixelRatio to 1/2
// NOTE: assume that having touch event implies a mobile, it may not be true
var onMobile = 'ontouchstart' in window ? true : false;
onMobile && this.devicePixelRatio(1/2)


// for chained API
return this;
});
Expand Down

0 comments on commit 2e94d2b

Please sign in to comment.