Skip to content

Commit

Permalink
Merge pull request #66 from greg-js/opener
Browse files Browse the repository at this point in the history
fixes #65: message pane staying open when clicked rapidly
  • Loading branch information
heysanil authored Aug 5, 2016
2 parents 481bc9b + 89b1279 commit 714eecc
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions app/components/keychain/KeychainComposerOpener.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,22 @@ class KeychainComposerOpener extends Component {

componentWillReceiveProps(nextProps) {
if (!this.props.isShowingOpener && nextProps.isShowingOpener) {
dynamics.animate(this.refs.opener, {
translateY: 0,
}, {
type: dynamics.spring,
duration: 700,
friction: 400,
})
this.moveOpener(0, 'spring', 700, 400)
} else if (this.props.isShowingOpener && !nextProps.isShowingOpener) {
this.moveOpener(64, 'easeInOut', 400, 250)
}
}

moveOpener(y, style, duration, friction) {
dynamics.animate(this.refs.opener, {
translateY: y,
}, {
type: dynamics[style],
duration,
friction,
})
}

render() {
return (
<div is="opener" ref="opener" onClick={ this.handleClick }>
Expand Down

0 comments on commit 714eecc

Please sign in to comment.