Skip to content

Commit

Permalink
Add context menu option to delete selected node. Update styles.
Browse files Browse the repository at this point in the history
  • Loading branch information
mkalus committed Aug 31, 2021
1 parent e60bf9c commit 6a93ac4
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/main/resources/js/segrada.js
Original file line number Diff line number Diff line change
Expand Up @@ -1257,7 +1257,7 @@ function escapeHTML(myString) {
else graphShow();
e.preventDefault();
});
$('#sg-graph-action-remove').click(function(e) {
$('.sg-graph-action-remove').click(function(e) {
const selection = graphNetwork.getSelection();
if (selection.edges.length > 0) graphEdges.remove(selection.edges);
if (selection.nodes.length > 0) graphNodes.remove(selection.nodes);
Expand Down
8 changes: 7 additions & 1 deletion src/main/resources/less/single/segrada.less
Original file line number Diff line number Diff line change
Expand Up @@ -227,11 +227,17 @@ span.sg-color-icon {
z-index: 101;

border: 1px solid #666;
padding: 0.5em;
background-color: #fff;

a {
padding: 0.25em 0.5em;
display: block;
color: #666;
}
a:hover {
color: #fff;
background-color: #666;
text-decoration: none;
}
}

Expand Down
3 changes: 2 additions & 1 deletion src/main/webapp/WEB-INF/templates/partials/graph.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<a href="#" class="btn btn-link" id="sg-graph-action-restart" th:title="#{Clear}" aria-label="Clear"><i class="fa fa-bomb"></i></a>
<a href="#" th:href="@{/node/graph}" class="btn btn-link" id="sg-graph-action-reload" th:title="#{Reload}" aria-label="Reload"><i class="fa fa-refresh"></i></a>
<a href="#" class="btn btn-link" id="sg-graph-action-fit" th:title="#{Fit}" aria-label="Fit View"><i class="fa fa-arrows-alt"></i></a>
<a href="#" class="btn btn-link" id="sg-graph-action-remove" th:title="#{RemoveSelected}" aria-label="Remove Selected Elements"><i class="fa fa-minus-circle"></i></a>
<a href="#" class="btn btn-link sg-graph-action-remove" th:title="#{RemoveSelected}" aria-label="Remove Selected Elements"><i class="fa fa-minus-circle"></i></a>
</div>

<a href="#" class="btn btn-link" id="sg-graph-close" th:title="#{Close}" aria-label="Close"><i class="fa fa-times"></i></a>
Expand All @@ -33,6 +33,7 @@
<a href="#" th:attr="data-href=@{/node/graph/XXUIDXX?expand=true}" class="sg-graph-update" th:title="#{AddAllToGraph}"><i class="fa fa-share"></i> <span th:text="#{AddAllToGraphShort}">Add all</span></a>
<a href="#" class="sg-graph-node-fix" th:title="#{Fix}"><i class="fa fa-pause-circle"></i> <span th:text="#{Fix}">Fix</span></a>
<a href="#" class="sg-graph-node-unfix" th:title="#{Unfix}"><i class="fa fa-play-circle"></i> <span th:text="#{Unfix}">Unfix</span></a>
<a href="#" class="sg-graph-action-remove" th:title="#{Delete}"><i class="fa fa-times"></i> <span th:text="#{Delete}">Delete</span></a>
</div>

<div id="sg-graph-modal-save" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="sg-graph-modal-save-title">
Expand Down
2 changes: 1 addition & 1 deletion src/main/webapp/css/segrada.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 6a93ac4

Please sign in to comment.