return d3.rebind(context, dispatch, 'on');
};
-iD.version = '1.1.0';
+iD.version = '1.1.1';
(function() {
var detected = {};
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)
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);
};
draw.tail = function(_) {
- if (!_ || iD.behavior.Draw.usedTails[_] === undefined) {
- tail.text(_);
- iD.behavior.Draw.usedTails[_] = true;
- }
+ tail.text(_);
return draw;
};
.entityID(id));
function historyChanged() {
+ if (state === 'hide') return;
var entity = context.hasEntity(id);
if (!entity) return;
entityEditor.preset(context.presets().match(entity, context.graph()));
inspector.state = function(_) {
if (!arguments.length) return state;
state = _;
+ entityEditor.state(state);
return inspector;
};
.attr('class', 'tooltip-inner radial-menu-tooltip');
function mouseover(d, i) {
- var rect = context.surface().node().getBoundingClientRect(),
+ // Avoid getBoundingClientRect on SVG element; browser implementations
+ // differ: http://stackoverflow.com/questions/18153989/
+ var rect = context.surface().node().parentNode.getBoundingClientRect(),
angle = a0 + i * a,
dx = rect.left - (angle < 0 ? 200 : 0),
dy = rect.top;
} else if (!current) {
featureListWrap.classed('inspector-hidden', false);
inspectorWrap.classed('inspector-hidden', true);
+ inspector.state('hide');
}
};
} else if (!current) {
featureListWrap.classed('inspector-hidden', false);
inspectorWrap.classed('inspector-hidden', true);
+ inspector.state('hide');
}
};