Implemented "cancel" for edit
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import React, { Component } from 'react';
|
||||
import { observer } from 'mobx-react';
|
||||
import { browserHistory } from 'react-router';
|
||||
|
||||
import store from './DocumentEditStore';
|
||||
|
||||
@@ -50,6 +51,10 @@ class DocumentEdit extends Component {
|
||||
}
|
||||
}
|
||||
|
||||
onCancel = () => {
|
||||
browserHistory.goBack();
|
||||
}
|
||||
|
||||
state = {
|
||||
scrollTop: 0,
|
||||
}
|
||||
@@ -85,6 +90,9 @@ class DocumentEdit extends Component {
|
||||
<MenuItem onClick={ this.onPreviewToggle }>
|
||||
Preview <Switch checked={ store.preview } />
|
||||
</MenuItem>
|
||||
<MenuItem onClick={ this.onCancel }>
|
||||
Cancel
|
||||
</MenuItem>
|
||||
</DropdownMenu>
|
||||
</Flex>
|
||||
);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { observable, action, computed, autorun } from 'mobx';
|
||||
import { client } from 'utils/ApiClient';
|
||||
import localforage from 'localforage';
|
||||
import { browserHistory } from 'react-router'
|
||||
import { browserHistory } from 'react-router';
|
||||
|
||||
const DOCUMENT_EDIT_SETTINGS = 'DOCUMENT_EDIT_SETTINGS';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user