diff options
author | Sorin Davidoi <sorin.davidoi@gmail.com> | 2017-07-21 01:38:24 +0200 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2017-07-21 01:38:24 +0200 |
commit | c1bc5e14ebbecd8ffc6b4188fbf608e11f64422e (patch) | |
tree | 3c06dfd35b4e8f8d41a21383db7152c1cdbeb11d /app/javascript/mastodon/features/compose/index.js | |
parent | 4b911fea03a204a1a1cc0e5f63ede1679e0494c3 (diff) |
feat(compose): More space on mobile devices (#4282)
* feat(compose): More space on mobile devices * feat(compose): Hide navigation when typing on mobile devices * fix(compose): Make animation faster * fix(navigation_bar): Remove hardcoded title * fix(compose): Prevent accidental bluring * fix(compose): Increase max-height to 600px
Diffstat (limited to 'app/javascript/mastodon/features/compose/index.js')
-rw-r--r-- | app/javascript/mastodon/features/compose/index.js | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/app/javascript/mastodon/features/compose/index.js b/app/javascript/mastodon/features/compose/index.js index 6aa5de96c..e3cf2d33b 100644 --- a/app/javascript/mastodon/features/compose/index.js +++ b/app/javascript/mastodon/features/compose/index.js @@ -11,6 +11,7 @@ import SearchContainer from './containers/search_container'; import Motion from 'react-motion/lib/Motion'; import spring from 'react-motion/lib/spring'; import SearchResultsContainer from './containers/search_results_container'; +import { changeComposing } from '../../actions/compose'; const messages = defineMessages({ start: { id: 'getting_started.heading', defaultMessage: 'Getting started' }, @@ -47,6 +48,14 @@ export default class Compose extends React.PureComponent { this.props.dispatch(unmountCompose()); } + onFocus = () => { + this.props.dispatch(changeComposing(true)); + } + + onBlur = () => { + this.props.dispatch(changeComposing(false)); + } + render () { const { multiColumn, showSearch, intl } = this.props; @@ -82,8 +91,8 @@ export default class Compose extends React.PureComponent { <SearchContainer /> <div className='drawer__pager'> - <div className='drawer__inner'> - <NavigationContainer /> + <div className='drawer__inner' onFocus={this.onFocus}> + <NavigationContainer onClose={this.onBlur} /> <ComposeFormContainer /> </div> |