diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index 8bb82de7d..6a168d270 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -165,6 +165,13 @@ function toCamelCase(str) { .replace(/^(.)/, function($1) { return $1.toUpperCase(); }); }; +function isRetina(){ + if (window.matchMedia) { + var mq = window.matchMedia("only screen and (min--moz-device-pixel-ratio: 1.3), only screen and (-o-min-device-pixel-ratio: 2.6/2), only screen and (-webkit-min-device-pixel-ratio: 1.3), only screen and (min-device-pixel-ratio: 1.3), only screen and (min-resolution: 1.3dppx)"); + return (mq && mq.matches || (window.devicePixelRatio > 1)); + } +} + jQuery.event.special.remove = { remove: function(e) { if (e.handler) e.handler();