From 3ac3cf8c135a716f74e53218d40356281627b757 Mon Sep 17 00:00:00 2001 From: j Date: Tue, 26 Jan 2016 16:47:10 +0530 Subject: [PATCH] remove useless variable --- static/js/app.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/static/js/app.js b/static/js/app.js index 01d7c0a..4d782bd 100644 --- a/static/js/app.js +++ b/static/js/app.js @@ -1,7 +1,6 @@ window.app = (function() { var that = {}, coords, - foundLocation = false, map, marker, username = localStorage.username || 'Anonymous', @@ -136,7 +135,7 @@ window.app = (function() { removeUser(data[1]); } else if (data[0] == 'update') { data[2].id = data[1]; - updateUserLocation(data[2]); + updateUser(data[2]); } }; that.ws.onclose = function (event) { @@ -162,7 +161,7 @@ window.app = (function() { }) }) }; - if (!foundLocation) { + if (!marker) { if (!map) { L.mapbox.accessToken = config.mapboxAccessToken; map = L.mapbox.map('map', 'mapbox.streets') @@ -172,7 +171,6 @@ window.app = (function() { .bindPopup(options.title) .addTo(map); map.setView(coords, zoomLevel); - foundLocation = true; updateUserList(); } else { map.removeLayer(marker); @@ -186,7 +184,7 @@ window.app = (function() { }); } - function updateUserLocation(data) { + function updateUser(data) { var user = getUserById(data.id); if (!user) { user = createUser(data);