mirror of
https://github.com/maputnik/editor.git
synced 2026-03-28 21:20:03 +00:00
Improving keyboard bindings code
This commit is contained in:
@@ -75,17 +75,13 @@ export default class App extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
Mousetrap.bind(['ctrl+z'], this.onUndo.bind(this));
|
Mousetrap.bind(['mod+z'], this.onUndo.bind(this));
|
||||||
Mousetrap.bind(['command+z'], this.onUndo.bind(this));
|
Mousetrap.bind(['mod+y', 'mod+shift+z'], this.onRedo.bind(this));
|
||||||
Mousetrap.bind(['ctrl+y'], this.onRedo.bind(this));
|
|
||||||
Mousetrap.bind(['command+shift+z'], this.onRedo.bind(this));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
Mousetrap.unbind(['ctrl+z'], this.onUndo.bind(this));
|
Mousetrap.unbind(['mod+z'], this.onUndo.bind(this));
|
||||||
Mousetrap.unbind(['command+z'], this.onUndo.bind(this));
|
Mousetrap.unbind(['mod+y', 'mod+shift+z'], this.onRedo.bind(this));
|
||||||
Mousetrap.unbind(['ctrl+y'], this.onRedo.bind(this));
|
|
||||||
Mousetrap.unbind(['command+shift+z'], this.onRedo.bind(this));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
onReset() {
|
onReset() {
|
||||||
|
|||||||
Reference in New Issue
Block a user