Skip to content
This repository was archived by the owner on May 20, 2023. It is now read-only.

Commit ce6b10e

Browse files
author
HarshKhandeparkar
committed
feat: save slide hotkey
1 parent c9adc4c commit ce6b10e

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/components/Page/Page.jsx

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,19 +86,24 @@ export class Page extends Component {
8686
}
8787

8888
_setHotkeys() {
89-
hotkeys('ctrl+z, command+z', 'undo-redo', () => {
89+
hotkeys('ctrl+z, command+z', 'drawboard', () => {
9090
this.state.boardState.drawBoard.undo();
9191
})
9292

93-
hotkeys('ctrl+shift+z, command+shift+z', 'undo-redo', () => {
93+
hotkeys('ctrl+shift+z, command+shift+z', 'drawboard', () => {
9494
this.state.boardState.drawBoard.redo();
9595
})
9696

97-
hotkeys.setScope('undo-redo');
97+
hotkeys('ctrl+s, command+s', 'drawboard', (e) => {
98+
e.preventDefault();
99+
this._save();
100+
})
101+
102+
hotkeys.setScope('drawboard');
98103
}
99104

100105
_removeHotkeys() {
101-
hotkeys.deleteScope('undo-redo');
106+
hotkeys.deleteScope('drawboard');
102107
}
103108

104109
render() {

0 commit comments

Comments
 (0)