aboutsummaryrefslogtreecommitdiffstats
path: root/web/src/js
diff options
context:
space:
mode:
authorMatthew Shao <me@matshao.com>2017-06-28 21:48:22 +0800
committerMatthew Shao <me@matshao.com>2017-06-28 21:48:22 +0800
commitfebfeb9ef2bd9c412590c489e12f393f183b9a82 (patch)
treebbf7109a56be42e7db9c9e9be94eef718a9b3b3f /web/src/js
parent81c854e9097b9d8990899b41a1ac8f7050182763 (diff)
downloadmitmproxy-febfeb9ef2bd9c412590c489e12f393f183b9a82.tar.gz
mitmproxy-febfeb9ef2bd9c412590c489e12f393f183b9a82.tar.bz2
mitmproxy-febfeb9ef2bd9c412590c489e12f393f183b9a82.zip
[web] Minor update for Modal Component.
Diffstat (limited to 'web/src/js')
-rw-r--r--web/src/js/components/Header/FileMenu.jsx4
-rw-r--r--web/src/js/components/Modal/Modal.jsx2
-rw-r--r--web/src/js/components/Modal/ModalList.jsx2
-rw-r--r--web/src/js/components/ProxyApp.jsx2
4 files changed, 6 insertions, 4 deletions
diff --git a/web/src/js/components/Header/FileMenu.jsx b/web/src/js/components/Header/FileMenu.jsx
index 82855c43..62f721cf 100644
--- a/web/src/js/components/Header/FileMenu.jsx
+++ b/web/src/js/components/Header/FileMenu.jsx
@@ -36,7 +36,7 @@ export function FileMenu ({clearFlows, loadFlows, saveFlows, openModal}) {
&nbsp;Save...
</a>
- <a href="#" onClick={e => { openModal('OptionModal') }}>
+ <a href="#" onClick={e => { e.preventDefault(); openModal(); }}>
<i className="fa fa-fw fa-cog"></i>
&nbsp;Options
</a>
@@ -57,6 +57,6 @@ export default connect(
clearFlows: flowsActions.clear,
loadFlows: flowsActions.upload,
saveFlows: flowsActions.download,
- openModal: modalActions.setActiveModal,
+ openModal: () => modalActions.setActiveModal('OptionModal'),
}
)(FileMenu)
diff --git a/web/src/js/components/Modal/Modal.jsx b/web/src/js/components/Modal/Modal.jsx
index 3370ad36..e39f5415 100644
--- a/web/src/js/components/Modal/Modal.jsx
+++ b/web/src/js/components/Modal/Modal.jsx
@@ -11,7 +11,7 @@ class PureModal extends Component {
render() {
const { activeModal, hideModal } = this.props
- const ActiveModal = _.find(ModalList, m => m.name === activeModal )
+ const ActiveModal = ModalList.find(m => m.name === activeModal )
return(
activeModal ?
<div>
diff --git a/web/src/js/components/Modal/ModalList.jsx b/web/src/js/components/Modal/ModalList.jsx
index 41b36f00..8ba46b00 100644
--- a/web/src/js/components/Modal/ModalList.jsx
+++ b/web/src/js/components/Modal/ModalList.jsx
@@ -1,3 +1,3 @@
import OptionModal from './OptionModal'
-export default [ OptionModal, EmptyModal ]
+export default [ OptionModal ]
diff --git a/web/src/js/components/ProxyApp.jsx b/web/src/js/components/ProxyApp.jsx
index af5b3caa..8c3970bc 100644
--- a/web/src/js/components/ProxyApp.jsx
+++ b/web/src/js/components/ProxyApp.jsx
@@ -7,6 +7,7 @@ import MainView from './MainView'
import Header from './Header'
import EventLog from './EventLog'
import Footer from './Footer'
+import Modal from './Modal/Modal'
class ProxyAppMain extends Component {
@@ -28,6 +29,7 @@ class ProxyAppMain extends Component {
<EventLog key="eventlog"/>
)}
<Footer />
+ <Modal/>
</div>
)
}