mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Add menu options for raise/lower actions
This commit is contained in:
@@ -709,7 +709,7 @@ RED.view.tools = (function() {
|
||||
if (dir === "forwards") {
|
||||
movedNodes = RED.nodes.moveNodesForwards(nodesToMove);
|
||||
} else if (dir === "backwards") {
|
||||
movedNodes = RED.nodes.moveNodesBacks(nodesToMove);
|
||||
movedNodes = RED.nodes.moveNodesBackwards(nodesToMove);
|
||||
} else if (dir === "front") {
|
||||
movedNodes = RED.nodes.moveNodesToFront(nodesToMove);
|
||||
} else if (dir === "back") {
|
||||
|
@@ -504,9 +504,23 @@ RED.view = (function() {
|
||||
|
||||
RED.events.on("view:selection-changed", function(selection) {
|
||||
var hasSelection = (selection.nodes && selection.nodes.length > 0);
|
||||
var hasMultipleSelection = hasSelection && selection.nodes.length > 1;
|
||||
RED.menu.setDisabled("menu-item-edit-cut",!hasSelection);
|
||||
RED.menu.setDisabled("menu-item-edit-copy",!hasSelection);
|
||||
RED.menu.setDisabled("menu-item-edit-select-connected",!hasSelection);
|
||||
RED.menu.setDisabled("menu-item-view-tools-move-to-back",!hasSelection);
|
||||
RED.menu.setDisabled("menu-item-view-tools-move-to-front",!hasSelection);
|
||||
RED.menu.setDisabled("menu-item-view-tools-move-backwards",!hasSelection);
|
||||
RED.menu.setDisabled("menu-item-view-tools-move-forwards",!hasSelection);
|
||||
|
||||
RED.menu.setDisabled("menu-item-view-tools-align-left",!hasMultipleSelection);
|
||||
RED.menu.setDisabled("menu-item-view-tools-align-center",!hasMultipleSelection);
|
||||
RED.menu.setDisabled("menu-item-view-tools-align-right",!hasMultipleSelection);
|
||||
RED.menu.setDisabled("menu-item-view-tools-align-top",!hasMultipleSelection);
|
||||
RED.menu.setDisabled("menu-item-view-tools-align-middle",!hasMultipleSelection);
|
||||
RED.menu.setDisabled("menu-item-view-tools-align-bottom",!hasMultipleSelection);
|
||||
RED.menu.setDisabled("menu-item-view-tools-distribute-horizontally",!hasMultipleSelection);
|
||||
RED.menu.setDisabled("menu-item-view-tools-distribute-veritcally",!hasMultipleSelection);
|
||||
})
|
||||
|
||||
RED.actions.add("core:delete-selection",deleteSelection);
|
||||
|
Reference in New Issue
Block a user