Fix scrolling issues of iFrame.
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
{{> (include_partial "layouts/partials/head") }}
|
{{> (include_partial "layouts/partials/head") }}
|
||||||
|
|
||||||
<body>
|
<body class="{{#if iframeMode}}body--iframe{{/if}}">
|
||||||
|
|
||||||
<main>
|
<main>
|
||||||
{{> (include_block_template) }}
|
{{> (include_block_template) }}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
{{> (include_partial "layouts/partials/head") }}
|
{{> (include_partial "layouts/partials/head") }}
|
||||||
|
|
||||||
<body>
|
<body class="{{#if iframeMode}}body--iframe{{/if}}">
|
||||||
|
|
||||||
<main>
|
<main>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
|
|||||||
+1
-1
@@ -18,7 +18,7 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="preview">
|
<div class="preview">
|
||||||
<iframe id="preview_frame" src="{{ previewFrameUrl }}" class="breakpoint"></iframe>
|
<iframe id="preview_frame" src="{{ previewFrameUrl }}?iframe=true" class="breakpoint"></iframe>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script src="/scripts/dist/index.min.js"></script>
|
<script src="/scripts/dist/index.min.js"></script>
|
||||||
|
|||||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
@@ -98,7 +98,12 @@ function DataOptions(props = {}) {
|
|||||||
|
|
||||||
async function changeDataOption(e) {
|
async function changeDataOption(e) {
|
||||||
const dataName = e.target.value;
|
const dataName = e.target.value;
|
||||||
props.rootAttributes.previewFrame.src = window.devTool.previewFrameUrl + '?data=' + dataName;
|
|
||||||
|
const previewFrameUrl = new URL(window.devTool.previewFrameUrl);
|
||||||
|
previewFrameUrl.searchParams.set('data', dataName);
|
||||||
|
previewFrameUrl.searchParams.set('iframe', 'true');
|
||||||
|
|
||||||
|
props.rootAttributes.previewFrame.src = previewFrameUrl.href;
|
||||||
|
|
||||||
const dataOption = await fetchDataOptions(dataName);
|
const dataOption = await fetchDataOptions(dataName);
|
||||||
updateState(Object.assign({}, dataOption, {dataName}));
|
updateState(Object.assign({}, dataOption, {dataName}));
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
body {
|
body {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
overflow-y: hidden;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
main {
|
main {
|
||||||
@@ -8,4 +7,11 @@ main {
|
|||||||
margin-right: auto;
|
margin-right: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.body--iframe {
|
||||||
|
overflow-y: hidden;
|
||||||
|
}
|
||||||
|
.body--iframe main {
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
|
||||||
/*# sourceMappingURL=page--view.css.map */
|
/*# sourceMappingURL=page--view.css.map */
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
{"version":3,"sourceRoot":"","sources":["page--view.scss"],"names":[],"mappings":"AAAA;EACE;EACA;;;AAGF;EACE;EACA","file":"page--view.css"}
|
{"version":3,"sourceRoot":"","sources":["page--view.scss"],"names":[],"mappings":"AAAA;EACE;;;AAGF;EACE;EACA;;;AAIF;EACE;;AAEA;EACE","file":"page--view.css"}
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
body {
|
body {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
overflow-y: hidden;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
main {
|
main {
|
||||||
@@ -8,11 +7,11 @@ main {
|
|||||||
margin-right: auto;
|
margin-right: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Container rules must be provided by the projectStyles (theme).
|
// iFrame mode
|
||||||
//.container {
|
.body--iframe {
|
||||||
// max-width: 1200px;
|
overflow-y: hidden;
|
||||||
// margin-left: auto;
|
|
||||||
// margin-right: auto;
|
main {
|
||||||
// padding-left: 15px;
|
overflow: auto;
|
||||||
// padding-right: 15px;
|
}
|
||||||
//}
|
}
|
||||||
|
|||||||
@@ -97,7 +97,11 @@ app.get('/view/:baseView', async (req, res) => {
|
|||||||
include_partial: (filesPath) => handlebarLayoutsPath(modulesPath, filesPath),
|
include_partial: (filesPath) => handlebarLayoutsPath(modulesPath, filesPath),
|
||||||
include_block_template: () => handlebarLayoutsPath(projectPath, 'src', `${blockName}.template`),
|
include_block_template: () => handlebarLayoutsPath(projectPath, 'src', `${blockName}.template`),
|
||||||
section_class: `${blockName}--${jsonFileName}`,
|
section_class: `${blockName}--${jsonFileName}`,
|
||||||
base_url: '/'
|
base_url: '/',
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!!req.query.iframe) {
|
||||||
|
data.iframeMode = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
const baseView = req.params.baseView ?? 'container';
|
const baseView = req.params.baseView ?? 'container';
|
||||||
|
|||||||
Reference in New Issue
Block a user