mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2025-04-10 20:09:53 +00:00
Nodes can be deselected on click
This commit is contained in:
parent
3192ce4376
commit
bfe6613871
@ -94,6 +94,17 @@ describe('SelectionTool', () => {
|
||||
expect(svg.selectAll('.selected').size()).toEqual(1);
|
||||
expect(svg.select('.selected').datum().name).toEqual("Node 1");
|
||||
});
|
||||
|
||||
describe('SelectionTool can deselect after click outside', () => {
|
||||
beforeEach(() => {
|
||||
svg.node().dispatchEvent(new MouseEvent('mousedown', {clientX: 300, clientY: 300}));
|
||||
});
|
||||
|
||||
it('should have no selection', () => {
|
||||
expect(svg.selectAll('.selected').size()).toEqual(0);
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe('SelectionTool can handle end of selection in reverse direction', () => {
|
||||
@ -104,7 +115,6 @@ describe('SelectionTool', () => {
|
||||
});
|
||||
|
||||
it('node should be selected', () => {
|
||||
expect()
|
||||
expect(svg.select('.selected').datum().name).toEqual("Node 1");
|
||||
});
|
||||
});
|
||||
|
@ -30,6 +30,9 @@ export class SelectionTool {
|
||||
const start = transformation(mouse(parent));
|
||||
self.startSelection(start);
|
||||
|
||||
// clear selection
|
||||
self.selection.selectAll('.selectable').classed("selected", false);
|
||||
|
||||
subject
|
||||
.on("mousemove.selection", function() {
|
||||
const end = transformation(mouse(parent));
|
||||
|
Loading…
x
Reference in New Issue
Block a user