Permalink
Browse files

if has touchevent, set devicepixelratio to 0.5

  • Loading branch information...
1 parent 09cd4ef commit 2e94d2b6253ba5656c5465aae68a5e5ec0e9f707 @jeromeetienne committed Mar 3, 2013
Showing with 7 additions and 0 deletions.
  1. +7 −0 plugins/boilerplate/tquery.world.boilerplate.js
@@ -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;
});

0 comments on commit 2e94d2b

Please sign in to comment.