From 72620ed668afaba1afa353142962bb8b1f4e565f Mon Sep 17 00:00:00 2001 From: Philipp Schaefer Date: Wed, 2 Oct 2013 23:40:51 +0200 Subject: [PATCH] got rid of redundant code --- code/chat.js | 1 - code/debugging.js | 4 ---- code/geosearch.js | 2 +- code/smartphone.js | 5 +---- code/utils_misc.js | 2 +- 5 files changed, 3 insertions(+), 11 deletions(-) diff --git a/code/chat.js b/code/chat.js index ad1032ce..71d0196c 100644 --- a/code/chat.js +++ b/code/chat.js @@ -540,7 +540,6 @@ window.chat.show = function(name) { ? $('#updatestatus').hide() : $('#updatestatus').show(); $('#chat, #chatinput').show(); - $('#map').css('visibility', 'hidden'); var t = $(''+name+''); window.chat.chooseAnchor(t); diff --git a/code/debugging.js b/code/debugging.js index 14663184..b1d2bbe8 100644 --- a/code/debugging.js +++ b/code/debugging.js @@ -23,10 +23,6 @@ window.debug.console = function() { } window.debug.console.show = function() { - if (window.isSmartphone()) { - $('#scrollwrapper, #updatestatus').hide(); - $('#map').css('visibility', 'hidden'); - } $('#chat, #chatinput').show(); window.debug.console.create(); $('#chatinput mark').css('cssText', 'color: #bbb !important').text('debug:'); diff --git a/code/geosearch.js b/code/geosearch.js index ab67a56c..b926e9d8 100644 --- a/code/geosearch.js +++ b/code/geosearch.js @@ -29,6 +29,6 @@ window.search = function(search) { northEast = new L.LatLng(b[1], b[3]), bounds = new L.LatLngBounds(southWest, northEast); window.map.fitBounds(bounds); - if(window.isSmartphone()) window.smartphone.mapButton.click(); + if(window.isSmartphone()) window.show('map'); }); } diff --git a/code/smartphone.js b/code/smartphone.js index 3efa7948..56e0c57c 100644 --- a/code/smartphone.js +++ b/code/smartphone.js @@ -35,7 +35,6 @@ window.runOnSmartphonesBeforeBoot = function() { } window.smartphone.mapButton = $('map').click(function() { - $('#chat, #chatinput, #scrollwrapper').hide(); $('#map').css('visibility', 'visible'); $('#updatestatus').show(); $('#chatcontrols a .active').removeClass('active'); @@ -43,8 +42,6 @@ window.runOnSmartphonesBeforeBoot = function() { }); window.smartphone.sideButton = $('info').click(function() { - $('#chat, #chatinput, #updatestatus').hide(); - $('#map').css('visibility', 'hidden'); $('#scrollwrapper').show(); $('.active').removeClass('active'); $("#chatcontrols a:contains('info')").addClass('active'); @@ -112,7 +109,7 @@ window.runOnSmartphonesAfterBoot = function() { if(!isSmartphone()) return; console.warn('running smartphone post boot stuff'); - smartphone.mapButton.click(); + window.show('map'); // add a div/hook for updating mobile info $('#updatestatus').prepend('
'); diff --git a/code/utils_misc.js b/code/utils_misc.js index 1da80f29..c421bb52 100644 --- a/code/utils_misc.js +++ b/code/utils_misc.js @@ -328,7 +328,7 @@ window.rangeLinkClick = function() { if(window.portalRangeIndicator) window.map.fitBounds(window.portalRangeIndicator.getBounds()); if(window.isSmartphone()) - window.smartphone.mapButton.click(); + window.show('map'); } window.showPortalPosLinks = function(lat, lng, name) {