mirror of
https://github.com/muerwre/orchidmap-front.git
synced 2025-04-25 11:06:40 +07:00
routes: backend endpoint
This commit is contained in:
parent
d11dd9043c
commit
c69da00b2a
10 changed files with 106 additions and 15 deletions
|
@ -33,7 +33,7 @@ type Props = {
|
|||
|
||||
class Component extends React.PureComponent<Props, void> {
|
||||
componentDidMount() {
|
||||
window.addEventListener('keydown', this.props.keyPressed);
|
||||
window.addEventListener('keydown', this.keyPressed);
|
||||
|
||||
const obj = document.getElementById('control-dialog');
|
||||
const { width } = this.panel.getBoundingClientRect();
|
||||
|
@ -44,9 +44,21 @@ class Component extends React.PureComponent<Props, void> {
|
|||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
window.removeEventListener('keydown', this.props.keyPressed);
|
||||
window.removeEventListener('keydown', this.keyPressed);
|
||||
}
|
||||
|
||||
keyPressed = e => {
|
||||
// if (
|
||||
// e.target.tagName === 'INPUT' ||
|
||||
// e.target.tagName === 'TEXTAREA'
|
||||
// ) {
|
||||
// if (e.key === 'Escape') e.target.blur();
|
||||
// return;
|
||||
// }
|
||||
|
||||
this.props.keyPressed(e);
|
||||
};
|
||||
|
||||
startPolyMode = () => this.props.setMode(MODES.POLY);
|
||||
startStickerMode = () => this.props.setMode(MODES.STICKERS_SELECT);
|
||||
startRouterMode = () => this.props.setMode(MODES.ROUTER);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue