mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-15 21:48:20 +02:00
Simple map-tail minimalism. Fixes #467
This commit is contained in:
@@ -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() || {},
|
||||
|
||||
@@ -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() || {},
|
||||
|
||||
@@ -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()});
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
|
||||
@@ -53,6 +53,7 @@ d3.tail = function() {
|
||||
};
|
||||
|
||||
tail.text = function(_) {
|
||||
if (!arguments.length) return text;
|
||||
if (_ === false) {
|
||||
text = _;
|
||||
container.style('display', 'none');
|
||||
|
||||
Reference in New Issue
Block a user