Added keyboard shortcut for move

This commit is contained in:
Jori Lallo
2017-09-04 15:08:23 -07:00
parent 483bf29cc4
commit 86a1792c8a
2 changed files with 10 additions and 3 deletions

View File

@@ -4,13 +4,13 @@ import get from 'lodash/get';
import styled from 'styled-components';
import { observable } from 'mobx';
import { observer, inject } from 'mobx-react';
import { withRouter, Prompt, Route } from 'react-router';
import { withRouter, Prompt } from 'react-router';
import keydown from 'react-keydown';
import Flex from 'components/Flex';
import { color, layout } from 'styles/constants';
import { collectionUrl, updateDocumentUrl } from 'utils/routeHelpers';
import Document from 'models/Document';
import Modal from 'components/Modal';
import DocumentMove from './components/DocumentMove';
import UiStore from 'stores/UiStore';
import DocumentsStore from 'stores/DocumentsStore';
@@ -77,6 +77,12 @@ type Props = {
this.props.ui.clearActiveDocument();
}
@keydown('m')
goToMove(event) {
event.preventDefault();
this.props.history.push(`${this.document.url}/move`);
}
loadDocument = async props => {
if (props.newDocument) {
const newDocument = new Document({

View File

@@ -1,8 +1,9 @@
- `Cmd+Enter` - Save and exit document editor
- `Cmd+S` - Save document and continue editing
- `Cmd+s` - Save document and continue editing
- `Cmd+Esc` - Cancel edit
- `/` or `t` - Jump to search
- `d` - Jump to dashboard
- `c` - Compose within a collection
- `e` - Edit document
- `m` - Move document
- `?` - This guide