mirror of
https://github.com/a-nyx/maputnik-with-pmtiles.git
synced 2025-01-30 23:45:29 +01:00
Revert change to undo/redo
This commit is contained in:
parent
a346d757fd
commit
0bd62985b9
1 changed files with 4 additions and 15 deletions
|
@ -85,28 +85,17 @@ export default class App extends React.Component {
|
||||||
this.layerWatcher = new LayerWatcher({
|
this.layerWatcher = new LayerWatcher({
|
||||||
onVectorLayersChange: v => this.setState({ vectorLayers: v })
|
onVectorLayersChange: v => this.setState({ vectorLayers: v })
|
||||||
})
|
})
|
||||||
|
|
||||||
this.onKeyDown = this.onKeyDown.bind(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
onKeyDown(e) {
|
|
||||||
console.log("??? keyCode ctrlKey="+e.ctrlKey+", keyCode="+e.keyCode)
|
|
||||||
// Control + Z
|
|
||||||
if(e.ctrlKey && e.keyCode === 90) {
|
|
||||||
this.onUndo(e);
|
|
||||||
}
|
|
||||||
else if(e.ctrlKey && e.keyCode === 89) {
|
|
||||||
this.onRedo(e);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
this.fetchSources();
|
this.fetchSources();
|
||||||
document.addEventListener("keydown", this.onKeyDown);
|
Mousetrap.bind(['ctrl+z'], this.onUndo.bind(this));
|
||||||
|
Mousetrap.bind(['ctrl+y'], this.onRedo.bind(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
document.removeEventListener("keydown", this.onKeyDown);
|
Mousetrap.unbind(['ctrl+z'], this.onUndo.bind(this));
|
||||||
|
Mousetrap.unbind(['ctrl+y'], this.onRedo.bind(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
saveStyle(snapshotStyle) {
|
saveStyle(snapshotStyle) {
|
||||||
|
|
Loading…
Reference in a new issue