Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Edit->Delete menu option/action #670

Merged
merged 1 commit into from
Jan 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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