close permission selector when you click outside
This commit is contained in:
parent
73d88771af
commit
9d0924f722
2 changed files with 8 additions and 3 deletions
|
@ -1,7 +1,7 @@
|
||||||
import React, { PropTypes, Component } from 'react'
|
import React, { PropTypes, Component } from 'react'
|
||||||
|
|
||||||
// TODO how do we make it so that clicking elsewhere on the topic
|
import onClickOutsideAddon from 'react-onclickoutside'
|
||||||
// card cancels this
|
|
||||||
class Permission extends Component {
|
class Permission extends Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props)
|
super(props)
|
||||||
|
@ -22,6 +22,10 @@ class Permission extends Component {
|
||||||
this.setState({selectingPermission: false})
|
this.setState({selectingPermission: false})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
handleClickOutside = instance => {
|
||||||
|
this.closePermissionSelect()
|
||||||
|
}
|
||||||
|
|
||||||
liClick = value => event => {
|
liClick = value => event => {
|
||||||
this.closePermissionSelect()
|
this.closePermissionSelect()
|
||||||
this.props.updateTopic({
|
this.props.updateTopic({
|
||||||
|
@ -62,4 +66,4 @@ Permission.propTypes = {
|
||||||
updateTopic: PropTypes.func
|
updateTopic: PropTypes.func
|
||||||
}
|
}
|
||||||
|
|
||||||
export default Permission
|
export default onClickOutsideAddon(Permission)
|
||||||
|
|
|
@ -45,6 +45,7 @@
|
||||||
"react": "15.4.2",
|
"react": "15.4.2",
|
||||||
"react-dom": "15.4.2",
|
"react-dom": "15.4.2",
|
||||||
"react-dropzone": "3.9.1",
|
"react-dropzone": "3.9.1",
|
||||||
|
"react-onclickoutside": "^5.9.0",
|
||||||
"redux": "3.6.0",
|
"redux": "3.6.0",
|
||||||
"riek": "^1.0.7",
|
"riek": "^1.0.7",
|
||||||
"simplewebrtc": "2.2.2",
|
"simplewebrtc": "2.2.2",
|
||||||
|
|
Loading…
Add table
Reference in a new issue