mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-20 23:44:47 +02:00
Fix altKey behavior with multi-step drawing (fixes #803)
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 () {
|
||||
|
||||
Reference in New Issue
Block a user