Simple map-tail minimalism. Fixes #467

This commit is contained in:
Tom MacWright
2013-01-24 17:26:52 -05:00
parent b69b2c9246
commit 2527d57404
7 changed files with 12 additions and 7 deletions
+1 -1
View File
@@ -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() || {},
+1 -1
View File
@@ -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() || {},
+1 -1
View File
@@ -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()});
+1 -1
View File
@@ -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() {
+1 -1
View File
@@ -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() {
+6 -2
View File
@@ -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;
};
+1
View File
@@ -53,6 +53,7 @@ d3.tail = function() {
};
tail.text = function(_) {
if (!arguments.length) return text;
if (_ === false) {
text = _;
container.style('display', 'none');