Skip to content

Commit

Permalink
[explore] fix height in embed mode (apache#1898)
Browse files Browse the repository at this point in the history
* [explore] fix height in embed mode

* Linting
  • Loading branch information
mistercrunch authored Jan 6, 2017
1 parent c14c7ed commit 119b0c5
Showing 1 changed file with 23 additions and 10 deletions.
33 changes: 23 additions & 10 deletions superset/assets/javascripts/explore/components/EmbedCodeButton.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,21 @@ export default class EmbedCodeButton extends React.Component {
}

generateEmbedHTML() {
const srcLink = window.location.origin + this.props.slice.data.standalone_endpoint;
/* eslint max-len: 0 */
return `
<iframe
src="${srcLink}"
width="${this.state.width}"
height="${this.state.height}"
seamless frameBorder="0" scrolling="no">
</iframe>`;
const srcLink = (
window.location.origin +
this.props.slice.data.standalone_endpoint +
`&height=${this.state.height}`
);
return (
'<iframe\n' +
` width="${this.state.width}"\n` +
` height="${this.state.height}"\n` +
' seamless\n' +
' frameBorder="0" scrolling="no"\n' +
` src="${srcLink}"\n` +
'>\n' +
'</iframe>'
);
}

renderPopover() {
Expand All @@ -43,7 +49,14 @@ export default class EmbedCodeButton extends React.Component {
<div>
<div className="row">
<div className="col-sm-10">
<textarea name="embedCode" value={html} rows="4" readOnly className="form-control input-sm"></textarea>
<textarea
name="embedCode"
value={html}
rows="4"
readOnly
className="form-control input-sm"
>
</textarea>
</div>
<div className="col-sm-2">
<CopyToClipboard
Expand Down

0 comments on commit 119b0c5

Please sign in to comment.