Skip to content

Commit f4ff0b1

Browse files
committed
Merge branch 'bendman-bugfix/680-preview-dimensions'
2 parents 54002fe + 474c843 commit f4ff0b1

File tree

4 files changed

+52
-34
lines changed

4 files changed

+52
-34
lines changed

client/modules/IDE/pages/IDEView.jsx

Lines changed: 36 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -369,41 +369,43 @@ class IDEView extends React.Component {
369369
<header className="preview-frame__header">
370370
<h2 className="preview-frame__title">Preview</h2>
371371
</header>
372-
<div className="preview-frame-overlay" ref={(element) => { this.overlay = element; }}>
372+
<div className="preview-frame__content">
373+
<div className="preview-frame-overlay" ref={(element) => { this.overlay = element; }}>
374+
</div>
375+
<div>
376+
{(
377+
(
378+
(this.props.preferences.textOutput ||
379+
this.props.preferences.gridOutput ||
380+
this.props.preferences.soundOutput
381+
) &&
382+
this.props.ide.isPlaying
383+
) ||
384+
this.props.ide.isAccessibleOutputPlaying
385+
)
386+
}
387+
</div>
388+
<PreviewFrame
389+
htmlFile={this.props.htmlFile}
390+
files={this.props.files}
391+
content={this.props.selectedFile.content}
392+
isPlaying={this.props.ide.isPlaying}
393+
isAccessibleOutputPlaying={this.props.ide.isAccessibleOutputPlaying}
394+
textOutput={this.props.preferences.textOutput}
395+
gridOutput={this.props.preferences.gridOutput}
396+
soundOutput={this.props.preferences.soundOutput}
397+
setTextOutput={this.props.setTextOutput}
398+
setGridOutput={this.props.setGridOutput}
399+
setSoundOutput={this.props.setSoundOutput}
400+
dispatchConsoleEvent={this.props.dispatchConsoleEvent}
401+
autorefresh={this.props.preferences.autorefresh}
402+
previewIsRefreshing={this.props.ide.previewIsRefreshing}
403+
endSketchRefresh={this.props.endSketchRefresh}
404+
stopSketch={this.props.stopSketch}
405+
setBlobUrl={this.props.setBlobUrl}
406+
expandConsole={this.props.expandConsole}
407+
/>
373408
</div>
374-
<div>
375-
{(
376-
(
377-
(this.props.preferences.textOutput ||
378-
this.props.preferences.gridOutput ||
379-
this.props.preferences.soundOutput
380-
) &&
381-
this.props.ide.isPlaying
382-
) ||
383-
this.props.ide.isAccessibleOutputPlaying
384-
)
385-
}
386-
</div>
387-
<PreviewFrame
388-
htmlFile={this.props.htmlFile}
389-
files={this.props.files}
390-
content={this.props.selectedFile.content}
391-
isPlaying={this.props.ide.isPlaying}
392-
isAccessibleOutputPlaying={this.props.ide.isAccessibleOutputPlaying}
393-
textOutput={this.props.preferences.textOutput}
394-
gridOutput={this.props.preferences.gridOutput}
395-
soundOutput={this.props.preferences.soundOutput}
396-
setTextOutput={this.props.setTextOutput}
397-
setGridOutput={this.props.setGridOutput}
398-
setSoundOutput={this.props.setSoundOutput}
399-
dispatchConsoleEvent={this.props.dispatchConsoleEvent}
400-
autorefresh={this.props.preferences.autorefresh}
401-
previewIsRefreshing={this.props.ide.previewIsRefreshing}
402-
endSketchRefresh={this.props.endSketchRefresh}
403-
stopSketch={this.props.stopSketch}
404-
setBlobUrl={this.props.setBlobUrl}
405-
expandConsole={this.props.expandConsole}
406-
/>
407409
</div>
408410
</SplitPane>
409411
</SplitPane>

client/modules/IDE/reducers/files.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ const defaultCSS =
3131
margin: 0;
3232
padding: 0;
3333
}
34+
canvas {
35+
display: block;
36+
}
3437
`;
3538

3639
const initialState = () => {

client/styles/components/_preview-frame.scss

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@
55
border-width: 0;
66
}
77

8+
.preview-frame-holder {
9+
display: flex;
10+
flex-direction: column;
11+
height: 100%;
12+
}
813

914
.preview-frame-overlay {
1015
height: 100%;
@@ -37,3 +42,8 @@
3742
font-size: #{12 / $base-font-size}rem;
3843
font-weight: normal;
3944
}
45+
46+
.preview-frame__content {
47+
position: relative;
48+
flex: 1 1 0;
49+
}

server/scripts/examples.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ const defaultCSS =
2828
margin: 0;
2929
padding: 0;
3030
}
31+
canvas {
32+
display: block;
33+
}
3134
`;
3235

3336
const clientId = process.env.GITHUB_ID;

0 commit comments

Comments
 (0)