mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-16 05:49:16 +02:00
Tail should appear only first time
This commit is contained in:
+10
-6
@@ -91,9 +91,12 @@ iD.behavior.Draw = function(context) {
|
||||
|
||||
function draw(selection) {
|
||||
context.install(hover);
|
||||
context.install(tail);
|
||||
context.install(edit);
|
||||
|
||||
if (!iD.behavior.Draw.usedTails[tail.text()]) {
|
||||
context.install(tail);
|
||||
}
|
||||
|
||||
keybinding
|
||||
.on('⌫', backspace)
|
||||
.on('⌦', del)
|
||||
@@ -112,9 +115,13 @@ iD.behavior.Draw = function(context) {
|
||||
|
||||
draw.off = function(selection) {
|
||||
context.uninstall(hover);
|
||||
context.uninstall(tail);
|
||||
context.uninstall(edit);
|
||||
|
||||
if (!iD.behavior.Draw.usedTails[tail.text()]) {
|
||||
context.uninstall(tail);
|
||||
iD.behavior.Draw.usedTails[tail.text()] = true;
|
||||
}
|
||||
|
||||
selection
|
||||
.on('mousedown.draw', null)
|
||||
.on('mousemove.draw', null);
|
||||
@@ -127,10 +134,7 @@ iD.behavior.Draw = function(context) {
|
||||
};
|
||||
|
||||
draw.tail = function(_) {
|
||||
if (!_ || iD.behavior.Draw.usedTails[_] === undefined) {
|
||||
tail.text(_);
|
||||
iD.behavior.Draw.usedTails[_] = true;
|
||||
}
|
||||
tail.text(_);
|
||||
return draw;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user