Skip to content

Commit 46ef60f

Browse files
author
Ives van Hoorne
committed
Browser compat fixes
1 parent 520b45b commit 46ef60f

File tree

7 files changed

+27
-34
lines changed

7 files changed

+27
-34
lines changed

src/app/components/sandbox/CodeEditor/Header.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ const Container = styled.div`
1010
box-shadow: 0 3px 3px ${props => props.theme.background2};
1111
color: ${props => props.theme.white};
1212
padding: 0.5rem 1rem;
13+
height: 3rem;
1314
flex: 0 0 3rem;
1415
box-sizing: border-box;
1516
justify-content: space-between;

src/app/components/sandbox/CodeEditor/index.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,14 @@ type Props = {
3131
};
3232

3333
const Container = styled.div`
34-
position: relative;
35-
display: flex;
36-
flex-direction: column;
3734
width: 100%;
3835
height: 100%;
39-
overflow: auto;
4036
`;
4137

4238
const CodeContainer = styled.div`
43-
position: relative;
4439
overflow: auto;
40+
width: 100%;
41+
height: calc(100% - 6rem);
4542
`;
4643

4744
const handleError = (cm, currentError, nextError, nextCode, nextId) => {

src/app/components/sandbox/Preview/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const Container = styled.div`
2424

2525
const StyledFrame = styled.iframe`
2626
border-width: 0px;
27-
height: calc(100% - 6rem);
27+
height: calc(100% - 3rem);
2828
width: 100%;
2929
`;
3030

src/app/pages/Sandbox/Editor/Content/Header/ShareView.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ export default class ShareView extends React.PureComponent {
160160
};
161161

162162
getIframeScript = () =>
163-
`<iframe src=${this.getEmbedUrl()} style="width:100%; height:500px; border:0; border-radius: 3px; overflow:hidden;" sandbox="allow-modals allow-forms allow-popups allow-scripts allow-same-origin"></iframe>`;
163+
`<iframe src=${this.getEmbedUrl()} style="width:100%; height:500px; border:0; border-radius: 4px; overflow:hidden;" sandbox="allow-modals allow-forms allow-popups allow-scripts allow-same-origin"></iframe>`;
164164

165165
select = function(event) {
166166
event.target.select();

src/app/pages/Sandbox/Editor/Content/index.js

Lines changed: 19 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import CodeEditor from 'app/components/sandbox/CodeEditor';
2323
import Preview from 'app/components/sandbox/Preview';
2424

2525
import Header from './Header';
26-
import Relative from '../../../../components/Relative';
2726

2827
type Props = {
2928
sandbox: Sandbox,
@@ -39,9 +38,6 @@ type State = {
3938
};
4039

4140
const FullSize = styled.div`
42-
display: flex;
43-
flex-direction: column;
44-
flex: auto;
4541
height: 100%;
4642
width: 100%;
4743
pointer-events: ${props => props.inactive ? 'none' : 'all'};
@@ -164,27 +160,25 @@ class EditorPreview extends React.PureComponent {
164160
userActions={userActions}
165161
user={user}
166162
/>
167-
<div style={{ height: '100%', width: '100%', position: 'relative' }}>
168-
<SplitPane
169-
onDragStarted={this.startResizing}
170-
onDragFinished={this.stopResizing}
171-
split="vertical"
172-
defaultSize="50%"
173-
minSize={360}
174-
primary="second"
175-
paneStyle={{ height: '100%' }}
176-
pane1Style={{ display: sandbox.showEditor ? 'block' : 'none' }}
177-
pane2Style={{
178-
display: sandbox.showPreview ? 'block' : 'none',
179-
minWidth: sandbox.showPreview && !sandbox.showEditor
180-
? '100%'
181-
: 'inherit',
182-
}}
183-
>
184-
{sandbox.showEditor && EditorPane}
185-
{PreviewPane}
186-
</SplitPane>
187-
</div>
163+
<SplitPane
164+
onDragStarted={this.startResizing}
165+
onDragFinished={this.stopResizing}
166+
split="vertical"
167+
defaultSize="50%"
168+
minSize={360}
169+
primary="second"
170+
paneStyle={{ height: '100%' }}
171+
pane1Style={{ display: sandbox.showEditor ? 'block' : 'none' }}
172+
pane2Style={{
173+
display: sandbox.showPreview ? 'block' : 'none',
174+
minWidth: sandbox.showPreview && !sandbox.showEditor
175+
? '100%'
176+
: 'inherit',
177+
}}
178+
>
179+
{sandbox.showEditor && EditorPane}
180+
{PreviewPane}
181+
</SplitPane>
188182
</FullSize>
189183
);
190184
}

src/embed/components/Content.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const Container = styled.div`
2020
const Split = styled.div`
2121
position: relative;
2222
width: ${props => props.show ? '100%' : '0px'};
23-
height: 100%;
23+
height: ${props => props.editor ? 'calc(100% + 3rem)' : '100%'};
2424
`;
2525

2626
type Props = {
@@ -67,7 +67,7 @@ export default class Content extends React.Component {
6767

6868
return (
6969
<Container>
70-
<Split show={showEditor}>
70+
<Split editor show={showEditor}>
7171
{showEditor &&
7272
<CodeEditor
7373
code={mainModule.code}

src/embed/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
<head>
55
<meta charset="utf-8">
6+
<meta name="viewport" content="width=device-width, initial-scale=1">
67
<!--<meta name="viewport" content="width=device-width, initial-scale=1">-->
78
<meta property="og:type" content="website">
89
<meta property="og:author" content='https://ivesvh.com'>

0 commit comments

Comments
 (0)