mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
parent
ae15380a9f
commit
1a134a88bd
4 changed files with 21 additions and 5 deletions
|
@ -873,8 +873,7 @@ class App extends React.Component<ExcalidrawProps, AppState> {
|
|||
if (isWritableElement(event.target)) {
|
||||
return;
|
||||
}
|
||||
this.copyAll();
|
||||
this.actionManager.executeAction(actionDeleteSelected);
|
||||
this.cutAll();
|
||||
event.preventDefault();
|
||||
});
|
||||
|
||||
|
@ -886,6 +885,11 @@ class App extends React.Component<ExcalidrawProps, AppState> {
|
|||
event.preventDefault();
|
||||
});
|
||||
|
||||
private cutAll = () => {
|
||||
this.copyAll();
|
||||
this.actionManager.executeAction(actionDeleteSelected);
|
||||
};
|
||||
|
||||
private copyAll = () => {
|
||||
copyToClipboard(this.scene.getElements(), this.state);
|
||||
};
|
||||
|
@ -3621,6 +3625,10 @@ class App extends React.Component<ExcalidrawProps, AppState> {
|
|||
|
||||
ContextMenu.push({
|
||||
options: [
|
||||
{
|
||||
label: t("labels.cut"),
|
||||
action: this.cutAll,
|
||||
},
|
||||
navigator.clipboard && {
|
||||
label: t("labels.copy"),
|
||||
action: this.copyAll,
|
||||
|
|
|
@ -240,6 +240,10 @@ export const ShortcutsDialog = ({ onClose }: { onClose?: () => void }) => {
|
|||
]}
|
||||
isOr={true}
|
||||
/>
|
||||
<Shortcut
|
||||
label={t("labels.cut")}
|
||||
shortcuts={[getShortcutKey("CtrlOrCmd+X")]}
|
||||
/>
|
||||
<Shortcut
|
||||
label={t("labels.copy")}
|
||||
shortcuts={[getShortcutKey("CtrlOrCmd+C")]}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue