diff options
Diffstat (limited to 'web/src/js/components/ContentView')
-rw-r--r-- | web/src/js/components/ContentView/ContentViews.jsx | 1 | ||||
-rw-r--r-- | web/src/js/components/ContentView/ShowFullContentButton.jsx | 2 | ||||
-rw-r--r-- | web/src/js/components/ContentView/ViewSelector.jsx | 14 |
3 files changed, 8 insertions, 9 deletions
diff --git a/web/src/js/components/ContentView/ContentViews.jsx b/web/src/js/components/ContentView/ContentViews.jsx index 3db77af4..9feb0623 100644 --- a/web/src/js/components/ContentView/ContentViews.jsx +++ b/web/src/js/components/ContentView/ContentViews.jsx @@ -37,6 +37,7 @@ class ViewServer extends Component { componentWillMount(){ this.setContentView(this.props) } + componentWillReceiveProps(nextProps){ this.setContentView(nextProps) } diff --git a/web/src/js/components/ContentView/ShowFullContentButton.jsx b/web/src/js/components/ContentView/ShowFullContentButton.jsx index 17e61be4..acb094a7 100644 --- a/web/src/js/components/ContentView/ShowFullContentButton.jsx +++ b/web/src/js/components/ContentView/ShowFullContentButton.jsx @@ -14,7 +14,7 @@ ShowFullContentButton.propTypes = { function ShowFullContentButton ( {setShowFullContent, showFullContent} ){ return ( - !showFullContent && <Button className="view-all-content-btn" isXs={true} onClick={() => setShowFullContent(true)} text="Show full content"/> + !showFullContent && <Button className="view-all-content-btn btn-xs" onClick={() => setShowFullContent(true)} text="Show full content"/> ) } diff --git a/web/src/js/components/ContentView/ViewSelector.jsx b/web/src/js/components/ContentView/ViewSelector.jsx index 1959ec1e..59ec4276 100644 --- a/web/src/js/components/ContentView/ViewSelector.jsx +++ b/web/src/js/components/ContentView/ViewSelector.jsx @@ -2,8 +2,7 @@ import React, { PropTypes, Component } from 'react' import classnames from 'classnames' import { connect } from 'react-redux' import * as ContentViews from './ContentViews' -import { setContentView, setContentViewSelectorOpen } from "../../ducks/ui/flow"; - +import { setContentView } from "../../ducks/ui/flow"; function ViewItem({ name, setContentView, children }) { return ( @@ -29,24 +28,25 @@ class ViewSelector extends Component { constructor(props, context) { super(props, context) this.close = this.close.bind(this) + this.state = {open: false} } close() { - this.props.setContentViewSelectorOpen(false) + this.setState({open: false}) document.removeEventListener('click', this.close) } onDropdown(e){ e.preventDefault() - this.props.setContentViewSelectorOpen(!this.props.isContentViewSelectorOpen) + this.setState({open: !this.state.open}) document.addEventListener('click', this.close) } render() { - const {contentViews, activeView, isEdit, isContentViewSelectorOpen, setContentViewSelectorOpen, setContentView} = this.props + const {contentViews, activeView, isEdit, setContentView} = this.props let edit = ContentViews.Edit.displayName return ( - <div className={classnames('dropup pull-left', { open: isContentViewSelectorOpen })}> + <div className={classnames('dropup pull-left', { open: this.state.open })}> <a className="btn btn-default btn-xs" onClick={ e => this.onDropdown(e) } href="#"> @@ -74,9 +74,7 @@ export default connect ( contentViews: state.settings.contentViews, activeView: state.ui.flow.contentView, isEdit: !!state.ui.flow.modifiedFlow, - isContentViewSelectorOpen: state.ui.flow.isContentViewSelectorOpen }), { setContentView, - setContentViewSelectorOpen } )(ViewSelector) |