Skip to content

Commit

Permalink
Removes the 'Delete Selected Nodes' button and the listeners for the …
Browse files Browse the repository at this point in the history
…del/backspace keys (commented out) -- #262, #266
  • Loading branch information
chrtannus committed Mar 11, 2024
1 parent 636d8b2 commit 90a29dc
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/client/components/network-editor/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import FitScreenIcon from '@material-ui/icons/SettingsOverscan';
import AddIcon from '@material-ui/icons/Add';
import RemoveIcon from '@material-ui/icons/Remove';
import UndoIcon from '@material-ui/icons/Undo';
import DeleteIcon from '@material-ui/icons/Delete';
import RestoreIcon from '@material-ui/icons/SettingsBackupRestore';
import LinkIcon from '@material-ui/icons/Link';
import InsertDriveFileOutlinedIcon from '@material-ui/icons/InsertDriveFileOutlined';
Expand Down Expand Up @@ -172,12 +171,12 @@ function RestoreConfirmDialog({ open, isMobile, onOk, onCancel }) {
</ListItemIcon>
<ListItemText className={classes.itemText} primary="All nodes will be returned to their initial positions." />
</ListItem>
<ListItem className={classes.item}>
{/* <ListItem className={classes.item}>
<ListItemIcon className={classes.itemIcon}>
<KeyboardReturnIcon className={classes.itemIconIcon} />
</ListItemIcon>
<ListItemText className={classes.itemText} primary="All deleted nodes will be restored." />
</ListItem>
</ListItem> */}
</List>
</Paper>
</DialogContent>
Expand Down Expand Up @@ -370,11 +369,12 @@ const Main = ({
onClick: () => controller.undoHandler.undo(),
isEnabled: () => undoEnabled,
},
// {
// title: "Delete Selected Nodes",
// icon: <DeleteIcon />,
// onClick: () => controller.deleteSelectedNodes(),
// },
{
title: "Delete Selected Nodes",
icon: <DeleteIcon />,
onClick: () => controller.deleteSelectedNodes(),
}, {
title: "Restore Network to Initial Layout",
icon: <RestoreIcon />,
onClick: handleNetworkRestore,
Expand Down Expand Up @@ -417,9 +417,10 @@ const Main = ({
.bind('left', panner.panLeft)
.bind('right', panner.panRight)
.bind(['f', 'space'], panner.fit)
.bind(['backspace','del'], () => controller.deleteSelectedNodes());
// .bind(['backspace','del'], () => controller.deleteSelectedNodes())
;

return () => Mousetrap.unbind(['-','_','=','+','up','down','left','right','f','space','backspace','del']);
return () => Mousetrap.unbind(['-','_','=','+','up','down','left','right','f','space'/**,'backspace','del'*/]);
}, [panner]);

return (
Expand Down

0 comments on commit 90a29dc

Please sign in to comment.