From 5e45f55257fb9d1c03b6fe9409c013c13f5330eb Mon Sep 17 00:00:00 2001 From: Alex Trofimov Date: Sat, 16 Dec 2017 19:19:24 +0600 Subject: [PATCH] #957 Load retina images when window.devicePixelRatio > 1.5 --- template/_header_js.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/template/_header_js.html b/template/_header_js.html index 2497725a4f..cd95f76735 100644 --- a/template/_header_js.html +++ b/template/_header_js.html @@ -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);