mirror of
https://github.com/apache/superset.git
synced 2024-09-17 11:09:47 -04:00
Make explore container resize with browser window (#1608)
This commit is contained in:
parent
db1ed2a765
commit
face5245a9
@ -25,11 +25,18 @@ class ExploreViewContainer extends React.Component {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
componentDidMount() {
|
||||||
|
window.addEventListener('resize', this.handleResize.bind(this));
|
||||||
|
}
|
||||||
|
|
||||||
|
componentWillUnmount() {
|
||||||
|
window.removeEventListener('resize', this.handleResize.bind(this));
|
||||||
|
}
|
||||||
onQuery() {
|
onQuery() {
|
||||||
const data = {};
|
const data = {};
|
||||||
const form_data = this.props.form_data;
|
const form_data = this.props.form_data;
|
||||||
Object.keys(form_data).forEach((field) => {
|
Object.keys(form_data).forEach((field) => {
|
||||||
// filter out null fields
|
// filter out null fields
|
||||||
if (form_data[field] !== null && field !== 'datasource') {
|
if (form_data[field] !== null && field !== 'datasource') {
|
||||||
data[field] = form_data[field];
|
data[field] = form_data[field];
|
||||||
}
|
}
|
||||||
@ -64,6 +71,9 @@ class ExploreViewContainer extends React.Component {
|
|||||||
this.props.actions.updateExplore(
|
this.props.actions.updateExplore(
|
||||||
this.props.datasource_type, this.props.form_data.datasource, data);
|
this.props.datasource_type, this.props.form_data.datasource, data);
|
||||||
}
|
}
|
||||||
|
handleResize() {
|
||||||
|
this.setState({ height: this.getHeight() });
|
||||||
|
}
|
||||||
|
|
||||||
toggleModal() {
|
toggleModal() {
|
||||||
this.setState({ showModal: !this.state.showModal });
|
this.setState({ showModal: !this.state.showModal });
|
||||||
@ -72,6 +82,7 @@ class ExploreViewContainer extends React.Component {
|
|||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
|
id="explore-container"
|
||||||
className="container-fluid"
|
className="container-fluid"
|
||||||
style={{
|
style={{
|
||||||
height: this.state.height,
|
height: this.state.height,
|
||||||
|
Loading…
Reference in New Issue
Block a user