Skip to content

Commit

Permalink
feat(outline): connection outline only in multi-select
Browse files Browse the repository at this point in the history
  • Loading branch information
smbea committed Nov 9, 2023
1 parent 724912f commit af76b07
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
5 changes: 5 additions & 0 deletions assets/diagram-js.css
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,13 @@
stroke: var(--element-selected-outline-stroke-color);
}

.djs-connection.selected .djs-outline {
visibility: hidden;
}

.djs-multi-select .djs-element.selected .djs-outline {
stroke: var(--element-selected-outline-secondary-stroke-color);
visibility: visible;
}

.djs-shape.connect-ok .djs-visual > :nth-child(1) {
Expand Down
25 changes: 25 additions & 0 deletions test/spec/features/selection/SelectionVisualsSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ describe('features/selection/SelectionVisuals', function() {
outline = domQuery('.djs-outline', gfx);

expect(outline).to.exist;
expect(getComputedStyle(outline).visibility).to.equal('visible');
}));


Expand All @@ -88,6 +89,21 @@ describe('features/selection/SelectionVisuals', function() {
expect(domClasses(element).has('djs-multi-select'));
}));


it('should not show box for connection', inject(function(selection, canvas) {

// when
// debugger;
selection.select(connection);

// then
var gfx = canvas.getGraphics(connection),
outline = domQuery('.djs-outline', gfx);

expect(outline).to.exist;
expect(getComputedStyle(outline).visibility).to.equal('hidden');
}));

});


Expand Down Expand Up @@ -192,6 +208,15 @@ describe('features/selection/SelectionVisuals', function() {

}));


it('should show box for connection', inject(function(canvas) {
var gfx = canvas.getGraphics(connection),
outlineShape = domQuery('.djs-outline', gfx);

expect(outlineShape).to.exist;
expect(getComputedStyle(outlineShape).visibility).to.equal('visible');
}));

});

});
Expand Down

0 comments on commit af76b07

Please sign in to comment.