Skip to content

Commit

Permalink
fix(map): hide unused selector for link (#133)
Browse files Browse the repository at this point in the history
* fix

* delete comments
  • Loading branch information
Yassir-BenBOUBKER authored Mar 19, 2024
1 parent f46283f commit 56d1e78
Show file tree
Hide file tree
Showing 6 changed files with 837 additions and 842 deletions.
820 changes: 410 additions & 410 deletions src/main/webapp/js/app.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/main/webapp/js/diagramly/Editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -4545,7 +4545,7 @@
{
var sstate = this.editorUi.getSelectionState();

if (this.defaultColorSchemes != null && sstate.style.shape != 'image' &&
if (this.defaultColorSchemes != null && sstate.style.shape != 'image' && sstate.style.shape != 'connector' &&
!sstate.containsLabel && sstate.cells.length > 0)
{
this.container.appendChild(this.addStyles(this.createPanel('StyleFormatPanel-addStyles')));
Expand Down
33 changes: 14 additions & 19 deletions src/main/webapp/js/grapheditor/Format.js
Original file line number Diff line number Diff line change
Expand Up @@ -5055,8 +5055,16 @@ StyleFormatPanel.prototype.addStroke = function(container)
lineEnd.style.marginLeft = '3px';
lineEnd.style.height = '17px';

container.appendChild(colorPanel);
container.appendChild(altStylePanel);

const cells = ss.cells.filter((cell) => {
return graph.getModel().isEdge(cell) && cell.getAttribute('type') === 'LINK' && cell.getAttribute('linkType') !== 'SIMPLE';
});

if(cells.length === 0)
{
container.appendChild(colorPanel);
}

container.appendChild(stylePanel);

var arrowPanel = stylePanel.cloneNode(false);
Expand Down Expand Up @@ -5134,13 +5142,8 @@ StyleFormatPanel.prototype.addStroke = function(container)
{
perimeterUpdate.apply(this, arguments);
});

if (ss.edges.length == ss.cells.length)
{
container.appendChild(stylePanel2);
container.appendChild(arrowPanel);
}
else if (ss.vertices.length == ss.cells.length)

if (ss.vertices.length == ss.cells.length)
{
container.appendChild(perimeterPanel);
}
Expand Down Expand Up @@ -5255,16 +5258,8 @@ StyleFormatPanel.prototype.addStroke = function(container)
}
}

if (ss.edges.length == ss.cells.length)
{
altStylePanel.style.display = '';
stylePanel.style.display = 'none';
}
else
{
altStylePanel.style.display = 'none';
stylePanel.style.display = '';
}
altStylePanel.style.display = 'none';
stylePanel.style.display = '';

if (Graph.lineJumpsEnabled && ss.edges.length > 0 &&
ss.vertices.length == 0 && ss.lineJumps)
Expand Down
Loading

0 comments on commit 56d1e78

Please sign in to comment.