From 047897d0b0b3e7cd0644604b0844fd6207dd2539 Mon Sep 17 00:00:00 2001 From: Mike Primm Date: Tue, 29 Nov 2011 10:50:42 +0800 Subject: [PATCH] Make compass rose smaller on mobile device browsers --- web/css/dynmap_style.css | 8 ++++++++ web/js/map.js | 9 +++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/web/css/dynmap_style.css b/web/css/dynmap_style.css index fd6fcee6..764d15dd 100644 --- a/web/css/dynmap_style.css +++ b/web/css/dynmap_style.css @@ -669,6 +669,14 @@ background-image: url(../images/compass_W.png); } +.mobilecompass { + top: 5px; + right: 10px; + height: 42px; + width: 42px; + background-size: cover; +} + /******************* * Chat */ diff --git a/web/js/map.js b/web/js/map.js index 6c408a12..592b0a35 100644 --- a/web/js/map.js +++ b/web/js/map.js @@ -306,10 +306,11 @@ DynMap.prototype = { updateHeight(); }); // The Compass - var compass = $('
') - .addClass('compass') - .appendTo(container); - + var compass = $('
'). + addClass('compass'); + if(L.Browser.mobile) + compass.addClass('mobilecompass'); + compass.appendTo(container); // TODO: Enable hash-links. /* var link;