fixes #135
This commit is contained in:
parent
96321ca767
commit
40f31b0e5c
2 changed files with 10 additions and 1 deletions
|
@ -139,6 +139,11 @@ class PreviewFrame extends React.Component {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.props.fullView && this.props.files[0].id !== prevProps.files[0].id) {
|
||||||
|
this.renderSketch();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// small bug - if autorefresh is on, and the usr changes files
|
// small bug - if autorefresh is on, and the usr changes files
|
||||||
// in the sketch, preview will reload
|
// in the sketch, preview will reload
|
||||||
}
|
}
|
||||||
|
@ -223,7 +228,9 @@ class PreviewFrame extends React.Component {
|
||||||
const doc = ReactDOM.findDOMNode(this);
|
const doc = ReactDOM.findDOMNode(this);
|
||||||
if (this.props.isPlaying) {
|
if (this.props.isPlaying) {
|
||||||
srcDoc.set(doc, this.injectLocalFiles());
|
srcDoc.set(doc, this.injectLocalFiles());
|
||||||
this.props.endSketchRefresh();
|
if (this.props.endSketchRefresh) {
|
||||||
|
this.props.endSketchRefresh();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
doc.srcdoc = '';
|
doc.srcdoc = '';
|
||||||
srcDoc.set(doc, ' ');
|
srcDoc.set(doc, ' ');
|
||||||
|
@ -272,6 +279,7 @@ PreviewFrame.propTypes = {
|
||||||
autorefresh: PropTypes.bool.isRequired,
|
autorefresh: PropTypes.bool.isRequired,
|
||||||
endSketchRefresh: PropTypes.func.isRequired,
|
endSketchRefresh: PropTypes.func.isRequired,
|
||||||
previewIsRefreshing: PropTypes.bool.isRequired,
|
previewIsRefreshing: PropTypes.bool.isRequired,
|
||||||
|
fullView: PropTypes.bool,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default PreviewFrame;
|
export default PreviewFrame;
|
||||||
|
|
|
@ -26,6 +26,7 @@ class FullView extends React.Component {
|
||||||
head={
|
head={
|
||||||
<link type="text/css" rel="stylesheet" href="/preview-styles.css" />
|
<link type="text/css" rel="stylesheet" href="/preview-styles.css" />
|
||||||
}
|
}
|
||||||
|
fullView
|
||||||
isPlaying
|
isPlaying
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue