diff --git a/js/id/modes/add_area.js b/js/id/modes/add_area.js index 6b476a5b8..9c5404232 100644 --- a/js/id/modes/add_area.js +++ b/js/id/modes/add_area.js @@ -15,7 +15,7 @@ iD.modes.AddArea = function() { controller = mode.controller; map.dblclickEnable(false) - .tail('Click on the map to start drawing an area, like a park, lake, or building.'); + .tail('Click on the map to start drawing an area, like a park, lake, or building.', true); function add() { var datum = d3.select(d3.event.target).datum() || {}, diff --git a/js/id/modes/add_line.js b/js/id/modes/add_line.js index 6b3a747e1..e5ff5ee55 100644 --- a/js/id/modes/add_line.js +++ b/js/id/modes/add_line.js @@ -16,7 +16,7 @@ iD.modes.AddLine = function() { controller = mode.controller; map.dblclickEnable(false) - .tail('Click on the map to start drawing an road, path, or route.'); + .tail('Click on the map to start drawing an road, path, or route.', true); function add() { var datum = d3.select(d3.event.target).datum() || {}, diff --git a/js/id/modes/add_point.js b/js/id/modes/add_point.js index 40c8e84ad..89f7aa536 100644 --- a/js/id/modes/add_point.js +++ b/js/id/modes/add_point.js @@ -13,7 +13,7 @@ iD.modes.AddPoint = function() { history = mode.history, controller = mode.controller; - map.tail('Click on the map to add a point.'); + map.tail('Click on the map to add a point.', true); function add() { var node = iD.Node({loc: map.mouseCoordinates()}); diff --git a/js/id/modes/draw_area.js b/js/id/modes/draw_area.js index 8ad50c97b..fe053e793 100644 --- a/js/id/modes/draw_area.js +++ b/js/id/modes/draw_area.js @@ -36,7 +36,7 @@ iD.modes.DrawArea = function(wayId) { .on('add', add); mode.map.surface.call(behavior); - mode.map.tail('Click to add points to your area. Click the first point to finish the area.'); + mode.map.tail('Click to add points to your area. Click the first point to finish the area.', true); }; mode.exit = function() { diff --git a/js/id/modes/draw_line.js b/js/id/modes/draw_line.js index 1e09ab0ac..ef17479be 100644 --- a/js/id/modes/draw_line.js +++ b/js/id/modes/draw_line.js @@ -47,7 +47,7 @@ iD.modes.DrawLine = function(wayId, direction) { mode.map.surface.call(behavior); mode.map.tail('Click to add more points to the line. ' + 'Click on other lines to connect to them, and double-click to ' + - 'end the line.'); + 'end the line.', true); }; mode.exit = function() { diff --git a/js/id/renderer/map.js b/js/id/renderer/map.js index fff0deac7..1948694d3 100644 --- a/js/id/renderer/map.js +++ b/js/id/renderer/map.js @@ -311,8 +311,12 @@ iD.Map = function() { return map; }; - map.tail = function (_) { - tail.text(_); + var usedTails = {}; + map.tail = function (_, once) { + if (!_ || usedTails[_] === undefined) { + tail.text(_); + usedTails[_] = true; + } return map; }; diff --git a/js/lib/d3.tail.js b/js/lib/d3.tail.js index 8046e4a96..0667227ee 100644 --- a/js/lib/d3.tail.js +++ b/js/lib/d3.tail.js @@ -53,6 +53,7 @@ d3.tail = function() { }; tail.text = function(_) { + if (!arguments.length) return text; if (_ === false) { text = _; container.style('display', 'none');