From: Kai Krueger Date: Fri, 22 Apr 2011 16:07:36 +0000 (-0600) Subject: Deactivate OSB controller immediately after clicking a new bug X-Git-Tag: live~5096^2~192 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/8cb83adf8466f9df7a003a2859ab956ced7942be Deactivate OSB controller immediately after clicking a new bug --- diff --git a/app/views/site/index.html.erb b/app/views/site/index.html.erb index 08bada0b9..27ecf1fa7 100644 --- a/app/views/site/index.html.erb +++ b/app/views/site/index.html.erb @@ -133,11 +133,6 @@ end var loginName = "<%= @user.display_name %>" <% end %> - function createBugCallBack() { - map.osbControl.deactivate(); - document.getElementById("OpenLayers.Map_18_OpenLayers_Container").style.cursor = "default"; - } - function mapInit(){ map = createMap("map"); diff --git a/public/javascripts/openstreetbugs.js b/public/javascripts/openstreetbugs.js index fff37eec1..b7a4685b9 100644 --- a/public/javascripts/openstreetbugs.js +++ b/public/javascripts/openstreetbugs.js @@ -468,7 +468,6 @@ OpenLayers.Layer.OpenStreetBugs = new OpenLayers.Class(OpenLayers.Layer.Markers, + "&name="+encodeURIComponent(this.getUserName()) + "&format=js" ); - createBugCallBack(); }, /** @@ -634,6 +633,7 @@ OpenLayers.Control.OpenStreetBugs = new OpenLayers.Class(OpenLayers.Control, { */ click: function(e) { if(!this.map) return true; + deactivateControl(); var control = this; var lonlat = this.map.getLonLatFromViewPortPx(e.xy); @@ -827,6 +827,11 @@ function osbResponse(error) putAJAXMarker.layers = [ ]; putAJAXMarker.bugs = { }; +function deactivateControl() { + map.osbControl.deactivate(); + document.getElementById("OpenLayers.Map_18_OpenLayers_Container").style.cursor = "default"; + } + /* Translations */