mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-04-14 16:40:58 -04:00
Use existing helper to copy all state (#1098)
This commit is contained in:
parent
2a373571f8
commit
aa54364bd6
1 changed files with 5 additions and 4 deletions
|
@ -512,7 +512,7 @@ export class App extends React.Component<any, AppState> {
|
||||||
if (isWritableElement(event.target)) {
|
if (isWritableElement(event.target)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
copyToAppClipboard(globalSceneState.getAllElements(), this.state);
|
this.copyAll();
|
||||||
const { elements: nextElements, appState } = deleteSelectedElements(
|
const { elements: nextElements, appState } = deleteSelectedElements(
|
||||||
globalSceneState.getAllElements(),
|
globalSceneState.getAllElements(),
|
||||||
this.state,
|
this.state,
|
||||||
|
@ -527,10 +527,11 @@ export class App extends React.Component<any, AppState> {
|
||||||
if (isWritableElement(event.target)) {
|
if (isWritableElement(event.target)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
copyToAppClipboard(globalSceneState.getAllElements(), this.state);
|
this.copyAll();
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
});
|
});
|
||||||
private copyToAppClipboard = () => {
|
|
||||||
|
private copyAll = () => {
|
||||||
copyToAppClipboard(globalSceneState.getAllElements(), this.state);
|
copyToAppClipboard(globalSceneState.getAllElements(), this.state);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -2446,7 +2447,7 @@ export class App extends React.Component<any, AppState> {
|
||||||
options: [
|
options: [
|
||||||
navigator.clipboard && {
|
navigator.clipboard && {
|
||||||
label: t("labels.copy"),
|
label: t("labels.copy"),
|
||||||
action: this.copyToAppClipboard,
|
action: this.copyAll,
|
||||||
},
|
},
|
||||||
navigator.clipboard && {
|
navigator.clipboard && {
|
||||||
label: t("labels.paste"),
|
label: t("labels.paste"),
|
||||||
|
|
Loading…
Add table
Reference in a new issue