Skip to content

Commit

Permalink
Merge pull request #670 from mgesteiro/edit-delete
Browse files Browse the repository at this point in the history
Added Edit->Delete menu option/action
  • Loading branch information
cavearr authored Jan 30, 2023
2 parents 6de048a + f582a41 commit d53c5e6
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
13 changes: 10 additions & 3 deletions app/scripts/controllers/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,10 @@ angular
}
};

$scope.removeSelected = function () {
graph.removeSelected();
};

$scope.selectAll = function () {
checkGraph()
.then(function () {
Expand All @@ -673,9 +677,11 @@ angular
showToolBox();
};

/* redundant: patched via $scope - @mgesteiro
function removeSelected() {
project.removeSelected();
project.removeSelected(); // <- this is justa a wrapper of graph.removeSelected()
}
*/

$scope.fitContent = function () {
graph.fitContent();
Expand Down Expand Up @@ -1583,6 +1589,7 @@ angular
shortcuts.method("copySelected", $scope.copySelected);
shortcuts.method("pasteAndCloneSelected", $scope.pasteAndCloneSelected);
shortcuts.method("pasteSelected", $scope.pasteSelected);
shortcuts.method("removeSelected", $scope.removeSelected);
shortcuts.method("selectAll", $scope.selectAll);
shortcuts.method("fitContent", $scope.fitContent);

Expand All @@ -1603,10 +1610,10 @@ angular
// -- Show Floating toolbox
shortcuts.method("showToolBox", $scope.showToolBox);

shortcuts.method("removeSelected", removeSelected);
//shortcuts.method("removeSelected", removeSelected); // moved alongside other EDIT menu options
shortcuts.method("back", function () {
if (graph.isEnabled()) {
removeSelected();
graph.removeSelected();
} else {
console.log("--------> BACK!!!!");
//-- When inside a block in non-edit mode
Expand Down
9 changes: 9 additions & 0 deletions app/views/menu.html
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,15 @@
</span></a>
</li>

<!-- Edit/Delete -->
<li>
<a href ng-click="removeSelected()">
{{ 'Delete' | translate }}
<span class="shortcut">
{{ 'removeSelected' | shortcut }}
</span></a>
</li>

<!-- Edit/Select all -->
<li>
<a href ng-click="selectAll()">
Expand Down

0 comments on commit d53c5e6

Please sign in to comment.