Skip to content
Browse files

Merge pull request #2 from TheDom/master

Bugfix: The retina images were never served if the cookie was set before
  • Loading branch information...
2 parents 52691c7 + 46366bf commit d3b0c70c9584deede2a2585b6d17db949ff60799 @superacidjax committed
Showing with 4 additions and 3 deletions.
  1. +4 −3 vendor/assets/javascripts/clear_eyes.js
View
7 vendor/assets/javascripts/clear_eyes.js
@@ -1,4 +1,5 @@
-if (document.cookie == "") {
- document.cookie = 'devicePixelRatio = ' + window.devicePixelRatio;
- if (document.cookie != "devicePixelRatio=1") window.location.reload();
+if (document.cookie.indexOf('devicePixelRatio') == -1) {
+ var ratio = (window.devicePixelRatio !== undefined ? window.devicePixelRatio : 1);
+ document.cookie = 'devicePixelRatio=' + ratio + (document.cookie != "" ? "; " + document.cookie : "");
+ if (ratio > 1) window.location.reload();
}

4 comments on commit d3b0c70

@iloveitaly

This commit is not contained with the latest release on rubygems. Would be great to get this pulled in.

@superacidjax
@macfanatic

Still isn't in Rubygems as of today, utterly broken on desktop or with Google Analytics.

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