Skip to content

Commit

Permalink
fix(palette): correct separator spacing
Browse files Browse the repository at this point in the history
  • Loading branch information
nikku committed Mar 27, 2022
1 parent 6477c34 commit f697584
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 3 deletions.
4 changes: 2 additions & 2 deletions assets/diagram-js.css
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ marker.djs-dragger tspan {
}

.djs-palette .separator {
margin: 0 5px;
margin: 5px;
padding-top: 5px;

border: none;
Expand All @@ -395,7 +395,7 @@ marker.djs-dragger tspan {
}

.djs-palette .entry:before {
vertical-align: text-bottom;
vertical-align: initial;
}

.djs-palette .djs-palette-toggle {
Expand Down
44 changes: 43 additions & 1 deletion test/spec/features/palette/PaletteSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,13 @@ describe('features/palette', function() {

it('should add palette entries', inject(function(canvas, palette) {

var img =
'<svg width="46" height="46" viewBox="-2 -2 9.82 9.82" xmlns="http://www.w3.org/2000/svg">' +
'<path d="m1.86 5.12-.72-.53 1.17-1.5c-.61-.16-1.22-.32-1.83-.5l.28-.85 1.78.65L2.46.5h.9l-.08 1.9 1.78-.66.28.86-1.83.5 1.17 1.49-.72.53-1.05-1.58-1.05 1.58Z" />' +
'</svg>';

var imgUrl = 'data:image/svg+xml;utf8,' + encodeURIComponent(img);

// given
var entries = {
'entryA': {
Expand All @@ -146,9 +153,35 @@ describe('features/palette', function() {
console.log('click entryA', arguments);
}
},
'entryA2': {
alt: 'A2',
className: 'FOO',
action: function() {
console.log('click entryA2', arguments);
}
},
'separator1': {
separator: true
},
'entryB': {
alt: 'B',
imageUrl: imgUrl,
action: {
click: function() {
console.log('click entryB');
},
dragstart: function(event) {
console.log('dragstart entryB');
event.preventDefault();
}
}
},
'separator2': {
separator: true
},
'entryB': {
alt: 'B',
imageUrl: 'http://placehold.it/40x40',
imageUrl: imgUrl,
action: {
click: function() {
console.log('click entryB');
Expand All @@ -158,6 +191,15 @@ describe('features/palette', function() {
event.preventDefault();
}
}
},
'entryC': {
alt: 'C',
imageUrl: imgUrl,
action: {
click: function() {
console.log('click entryB');
}
}
}
};

Expand Down

0 comments on commit f697584

Please sign in to comment.