routes: backend endpoint

This commit is contained in:
muerwre 2018-12-12 17:32:08 +07:00
parent d11dd9043c
commit c69da00b2a
10 changed files with 106 additions and 15 deletions

View file

@ -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);