diff --git a/src/components/Sticky.jsx b/src/components/Sticky.jsx index 8100feb35..d42dba56f 100644 --- a/src/components/Sticky.jsx +++ b/src/components/Sticky.jsx @@ -7,14 +7,26 @@ export default class Sticky extends React.Component { super(props) this.mountSticky = (sticky) => { this.sticky = sticky } this.handleScroll = this.handleScroll.bind(this) + this.updateSticky = this.updateSticky.bind(this) } componentDidMount() { window.addEventListener('scroll', this.handleScroll) + document.addEventListener('refreshsticky', this.updateSticky) } componentWillUnmount() { window.removeEventListener('scroll', this.handleScroll) + document.removeEventListener('refreshsticky', this.updateSticky) + } + + updateSticky() { + setTimeout(() => { + if (this.sticky) { + this.sticky.updateInitialDimension() + this.sticky.update() + } + }) } handleScroll() { diff --git a/src/components/TeamManagement/TeamManagement.jsx b/src/components/TeamManagement/TeamManagement.jsx index e47afeab8..08a71ac99 100644 --- a/src/components/TeamManagement/TeamManagement.jsx +++ b/src/components/TeamManagement/TeamManagement.jsx @@ -52,12 +52,21 @@ class TeamManagement extends React.Component { } topcoderTeamInviteButtonClick() { + this.refreshStickyComp() this.setState({topcoderTeamInviteButtonExpanded: !this.state.topcoderTeamInviteButtonExpanded}) } projectTeamInviteButtonClick() { + this.refreshStickyComp() this.setState({projectTeamInviteButtonExpanded: !this.state.projectTeamInviteButtonExpanded}) } + + refreshStickyComp() { + const event = document.createEvent('Event') + event.initEvent('refreshsticky', true, true) + document.dispatchEvent(event) + } + componentWillReceiveProps(nextProps) { if (this.props.processingMembers !== nextProps.processingMembers && (!nextProps.processingMembers)) { this.props.onJoin(false) diff --git a/src/projects/detail/containers/DashboardContainer.jsx b/src/projects/detail/containers/DashboardContainer.jsx index 09b50e68f..58330c6e6 100644 --- a/src/projects/detail/containers/DashboardContainer.jsx +++ b/src/projects/detail/containers/DashboardContainer.jsx @@ -212,7 +212,7 @@ class DashboardContainer extends React.Component { {(matches) => { if (matches) { - return {leftArea} + return {leftArea} } else { return leftArea }