Fix altKey behavior with multi-step drawing (fixes #803)

This commit is contained in:
John Firebaugh
2013-02-18 21:14:32 -08:00
parent 9b5f506694
commit 88949d6624
3 changed files with 12 additions and 1 deletions
+3 -1
View File
@@ -89,7 +89,9 @@ iD.behavior.Draw = function(context) {
}
function draw(selection) {
context.install(hover);
if (!d3.event || !d3.event.altKey) {
context.install(hover);
}
keybinding
.on('⌫', backspace)
+3
View File
@@ -32,6 +32,9 @@ iD.behavior.Hover = function() {
selection.classed('behavior-hover', false)
.on('mouseover.hover', null)
.on('mouseout.hover', null);
selection.selectAll('.hover')
.classed('hover', false);
};
return hover;
+6
View File
@@ -22,6 +22,12 @@ describe("iD.behavior.Hover", function() {
container.call(iD.behavior.Hover().off);
expect(container).not.to.be.classed('behavior-hover')
});
it("removes the .hover class from all elements", function () {
container.append('span').attr('class', 'hover');
container.call(iD.behavior.Hover().off);
expect(container.select('span')).not.to.be.classed('hover')
});
});
describe("mouseover", function () {