Skip to content

Commit

Permalink
#957 Load retina images when window.devicePixelRatio > 1.5
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexTr committed Dec 16, 2017
1 parent 1b6acbd commit 5e45f55
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions template/_header_js.html
Expand Up @@ -9,10 +9,10 @@
});

(function(w) {
var dpr = (w.devicePixelRatio === undefined ? 1 : w.devicePixelRatio);
if ($.cookie('devicePixelRatio') == dpr || dpr <= 1.5)
var dpr = (w.devicePixelRatio === undefined ? 1 : Math.round(w.devicePixelRatio));
if ($.cookie('devicePixelRatio') == dpr || dpr < 2)
return;
$.cookie('devicePixelRatio', 2, {expires: 365, path: '/'});
$.cookie('devicePixelRatio', dpr, {expires: 365, path: '/'});
window.location.reload();
})(window);
</script>

0 comments on commit 5e45f55

Please sign in to comment.