mirror of
https://github.com/a-nyx/maputnik-with-pmtiles.git
synced 2024-12-31 00:20:32 +01:00
Improving keyboard bindings code
This commit is contained in:
parent
984581e01a
commit
7dfc5029a3
1 changed files with 4 additions and 8 deletions
|
@ -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() {
|
||||||
|
|
Loading…
Reference in a new issue