Permalink
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...
superacidjax committed Sep 16, 2012
2 parents 52691c7 + 46366bf commit d3b0c70c9584deede2a2585b6d17db949ff60799
Showing with 4 additions and 3 deletions.
  1. +4 −3 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 comment has been minimized.

Show comment
Hide comment
@iloveitaly

iloveitaly Dec 14, 2012

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

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

@superacidjax

This comment has been minimized.

Show comment
Hide comment
@superacidjax

superacidjax Dec 14, 2012

Owner
Owner

superacidjax replied Dec 14, 2012

@macfanatic

This comment has been minimized.

Show comment
Hide comment
@macfanatic

macfanatic Feb 7, 2013

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

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

@superacidjax

This comment has been minimized.

Show comment
Hide comment
@superacidjax

superacidjax Feb 7, 2013

Owner
Owner

superacidjax replied Feb 7, 2013

Please sign in to comment.