From 253080c8fbd3b757eee13fcbdb01e7427cacd9b8 Mon Sep 17 00:00:00 2001 From: hastarin Date: Wed, 8 May 2013 10:00:00 +1000 Subject: [PATCH 1/6] Remove offset for layer chooser. --- mobile/smartphone.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mobile/smartphone.css b/mobile/smartphone.css index a196e850..ab97eca5 100644 --- a/mobile/smartphone.css +++ b/mobile/smartphone.css @@ -10,7 +10,7 @@ body { .leaflet-control-layers { margin-left: 0 !important; - margin-top: 40px !important; + margin-top: 0 !important; } .leaflet-control-zoom { From 3b5d4490837993490ebc59572daaab3930e2c44f Mon Sep 17 00:00:00 2001 From: hastarin Date: Wed, 8 May 2013 23:19:33 +1000 Subject: [PATCH 2/6] Tweaked layerchooser and zoom control positions. --- mobile/smartphone.css | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/mobile/smartphone.css b/mobile/smartphone.css index 7f62f20c..26efe8e7 100644 --- a/mobile/smartphone.css +++ b/mobile/smartphone.css @@ -7,15 +7,18 @@ body { background: #0B3351 !important } +.leaflet-top .leaflet-control { + margin-top: 0 !important; +} .leaflet-control-layers { margin-left: 0 !important; margin-top: 0 !important; } -.leaflet-control-zoom { +.leaflet-top .leaflet-control-zoom { margin-left: 5px !important; - margin-top: 80px !important; + margin-top: 30px !important; } From 93f330718acff283968f971ae45e424385be097e Mon Sep 17 00:00:00 2001 From: hastarin Date: Thu, 9 May 2013 00:08:52 +1000 Subject: [PATCH 3/6] Moved scale bar to bottom left on mobile. --- plugins/scale-bar.user.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/plugins/scale-bar.user.js b/plugins/scale-bar.user.js index 23329456..6ab71f98 100644 --- a/plugins/scale-bar.user.js +++ b/plugins/scale-bar.user.js @@ -24,11 +24,16 @@ if(typeof window.plugin !== 'function') window.plugin = function() {}; window.plugin.scaleBar = function() {}; window.plugin.scaleBar.setup = function() { - $('head').append(''); // Before you ask: yes, I explicitely turned off imperial units. Imperial units // are worse than Internet Explorer 6 whirring fans combined. Upgrade to the metric // system already. - window.map.addControl(new L.Control.Scale({position: 'topleft', imperial: false, maxWidth: 200})); + if (window.isSmartphone()) { + $('head').append(''); + window.map.addControl(new L.Control.Scale({position: 'bottomleft', imperial: false, maxWidth: 200})); + } else { + $('head').append(''); + window.map.addControl(new L.Control.Scale({position: 'topleft', imperial: false, maxWidth: 200})); + } }; var setup = window.plugin.scaleBar.setup; From ff6d2614071dccb896a6798cfcf4a788a9922b10 Mon Sep 17 00:00:00 2001 From: hastarin Date: Thu, 9 May 2013 00:50:12 +1000 Subject: [PATCH 4/6] Tweaks to mobile for portal_highlighter and others. --- code/portal_highlighter.js | 4 ++-- code/window_management.js | 7 +++++++ mobile/smartphone.css | 25 +++++++++---------------- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/code/portal_highlighter.js b/code/portal_highlighter.js index e36274d9..bd945865 100644 --- a/code/portal_highlighter.js +++ b/code/portal_highlighter.js @@ -33,7 +33,7 @@ window.portalHighlighterControl = function() { }); $("#portal_highlight_select").val(_current_highlighter); $("#portal_highlight_select").change(function(){ changePortalHighlights($(this).val());}); - $(".leaflet-top.leaflet-left").css('padding-top','25px'); + $(".leaflet-top.leaflet-left").css('padding-top', window.isSmartphone ? '55px' : '20px'); $(".leaflet-control-scale-line").css('margin-top','25px'); } } @@ -61,4 +61,4 @@ window.resetHighlightedPortals = function() { } catch(e) {} }); -} \ No newline at end of file +} diff --git a/code/window_management.js b/code/window_management.js index 8da89133..99ffdc59 100644 --- a/code/window_management.js +++ b/code/window_management.js @@ -1,6 +1,7 @@ // created to start cleaning up "window" interaction // window.show = function(id) { + window.hideall(); switch(id) { case 'full': window.chat.show('full'); @@ -19,6 +20,7 @@ window.show = function(id) { break; case 'map': window.smartphone.mapButton.click(); + $('#portal_highlight_select').show(); break; case 'info': window.smartphone.sideButton.click(); @@ -28,3 +30,8 @@ window.show = function(id) { break; } } + +window.hideall = function() { + $('#chatcontrols, #chat, #chatinput, #sidebartoggle, #scrollwrapper, #updatestatus, #portal_highlight_select').hide(); + $('#map').css('visibility', 'hidden'); +} diff --git a/mobile/smartphone.css b/mobile/smartphone.css index 26efe8e7..6feda6e9 100644 --- a/mobile/smartphone.css +++ b/mobile/smartphone.css @@ -8,7 +8,8 @@ body { } .leaflet-top .leaflet-control { - margin-top: 0 !important; + margin-top: 5px !important; + margin-left: 5px !important; } .leaflet-control-layers { @@ -16,12 +17,6 @@ body { margin-top: 0 !important; } -.leaflet-top .leaflet-control-zoom { - margin-left: 5px !important; - margin-top: 30px !important; -} - - #geosearch { width: 100%; } @@ -129,6 +124,11 @@ body { display: none; } +.leaflet-control-layers-toggle { + width: 50px !important; + height: 50px !important; +} + .leaflet-control-layers-list label { padding: 6px 0; } @@ -138,13 +138,6 @@ body { } #portal_highlight_select{ - position: absolute; - top:42px; - left:310px; - z-index: 9999; - font-size:11px; - font-family: "coda",arial,helvetica,sans-serif; - background-color:#0E3C46; - color:#ffce00; - + top:0px !important; + left:60px !important; } From c630277c256b21952eedd1d23f4ac3ba197e26c9 Mon Sep 17 00:00:00 2001 From: hastarin Date: Thu, 9 May 2013 01:48:59 +1000 Subject: [PATCH 5/6] More tweaks to mobile layout. Known issues: - A touch is generating two clicks. Most noticeable with pan plugin. - The pan plugin requires the +/- zoom buttons be enabled. --- code/portal_highlighter.js | 2 +- code/smartphone.js | 2 -- mobile/smartphone.css | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/code/portal_highlighter.js b/code/portal_highlighter.js index bd945865..05bfd911 100644 --- a/code/portal_highlighter.js +++ b/code/portal_highlighter.js @@ -33,7 +33,7 @@ window.portalHighlighterControl = function() { }); $("#portal_highlight_select").val(_current_highlighter); $("#portal_highlight_select").change(function(){ changePortalHighlights($(this).val());}); - $(".leaflet-top.leaflet-left").css('padding-top', window.isSmartphone ? '55px' : '20px'); + $(".leaflet-top.leaflet-left").css('padding-top', '20px'); $(".leaflet-control-scale-line").css('margin-top','25px'); } } diff --git a/code/smartphone.js b/code/smartphone.js index cdbabc4f..562c7b38 100644 --- a/code/smartphone.js +++ b/code/smartphone.js @@ -77,8 +77,6 @@ window.runOnSmartphonesAfterBoot = function() { // disable img full view $('#portaldetails').off('click', '**'); - $('.leaflet-right').addClass('leaflet-left').removeClass('leaflet-right'); - // make buttons in action bar flexible var l = $('#chatcontrols a:visible'); l.css('width', 100/l.length + '%'); diff --git a/mobile/smartphone.css b/mobile/smartphone.css index 6feda6e9..ca0e782a 100644 --- a/mobile/smartphone.css +++ b/mobile/smartphone.css @@ -139,5 +139,5 @@ body { #portal_highlight_select{ top:0px !important; - left:60px !important; + left:0px !important; } From 593ec57633fbef471f09501e0c886899e51bd467 Mon Sep 17 00:00:00 2001 From: hastarin Date: Thu, 9 May 2013 01:55:36 +1000 Subject: [PATCH 6/6] Set maxZoom = 13 for desktop locate button too. --- code/geosearch.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/geosearch.js b/code/geosearch.js index 8204b646..7bd7d1ee 100644 --- a/code/geosearch.js +++ b/code/geosearch.js @@ -24,6 +24,6 @@ window.setupGeosearch = function() { e.preventDefault(); }); $('#geosearchwrapper img').click(function(){ - map.locate({setView : true});; + map.locate({setView : true, maxZoom: 13});; }); }