Skip to content

Commit

Permalink
Make explore container resize with browser window
Browse files Browse the repository at this point in the history
  • Loading branch information
vera-liu committed Nov 17, 2016
1 parent d5ef937 commit ad651c8
Showing 1 changed file with 12 additions and 1 deletion.
Expand Up @@ -23,11 +23,18 @@ class ExploreViewContainer extends React.Component {
};
}

componentDidMount() {
window.addEventListener('resize', this.handleResize.bind(this));
}

componentWillUnmount() {
window.removeEventListener('resize', this.handleResize.bind(this));
}
onQuery() {
const data = {};
const form_data = this.props.form_data;
Object.keys(form_data).forEach((field) => {
// filter out null fields
// filter out null fields
if (form_data[field] !== null && field !== 'datasource') {
data[field] = form_data[field];
}
Expand Down Expand Up @@ -59,10 +66,14 @@ class ExploreViewContainer extends React.Component {
this.props.actions.updateExplore(
this.props.datasource_type, this.props.form_data.datasource, data);
}
handleResize() {
this.setState({ height: this.getHeight() });
}

render() {
return (
<div
id="explore-container"
className="container-fluid"
style={{
height: this.state.height,
Expand Down

0 comments on commit ad651c8

Please sign in to comment.