Merge pull request #418 from jorilallo/new-doc-menu

Fixes: New document menu item not working:
This commit is contained in:
Tom Moor 2017-11-15 23:53:04 -08:00 committed by GitHub
commit f7e700698f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -20,17 +20,20 @@ class CollectionMenu extends Component {
collection: Collection,
};
onNewDocument = () => {
onNewDocument = (ev: SyntheticEvent) => {
ev.preventDefault();
const { collection, history } = this.props;
history.push(`${collection.url}/new`);
};
onEdit = () => {
onEdit = (ev: SyntheticEvent) => {
ev.preventDefault();
const { collection } = this.props;
this.props.ui.setActiveModal('collection-edit', { collection });
};
onDelete = () => {
onDelete = (ev: SyntheticEvent) => {
ev.preventDefault();
const { collection } = this.props;
this.props.ui.setActiveModal('collection-delete', { collection });
};