mirror of
https://github.com/chinchang/web-maker.git
synced 2025-07-26 08:11:17 +02:00
refactor console position in detached mode. fixes #319
This commit is contained in:
@@ -549,6 +549,7 @@ export default class ContentWrap extends Component {
|
||||
trackEvent('ui', 'updateCodeMode', mode);
|
||||
}
|
||||
}
|
||||
|
||||
detachPreview() {
|
||||
if (this.detachedWindow) {
|
||||
this.detachedWindow.focus();
|
||||
@@ -558,7 +559,6 @@ export default class ContentWrap extends Component {
|
||||
const iframeWidth = iframeBounds.width;
|
||||
const iframeHeight = iframeBounds.height;
|
||||
document.body.classList.add('is-detached-mode');
|
||||
window.globalConsoleContainerEl.insertBefore(window.consoleEl, null);
|
||||
|
||||
this.detachedWindow = window.open(
|
||||
'./preview.html',
|
||||
@@ -574,7 +574,6 @@ export default class ContentWrap extends Component {
|
||||
if (this.detachedWindow && this.detachedWindow.closed) {
|
||||
clearInterval(intervalID);
|
||||
document.body.classList.remove('is-detached-mode');
|
||||
$('#js-demo-side').insertBefore(window.consoleEl, null);
|
||||
this.detachedWindow = null;
|
||||
// Update main frame preview to get latest changes (which were not
|
||||
// getting reflected while detached window was open)
|
||||
|
@@ -1181,7 +1181,7 @@ export default class App extends Component {
|
||||
onEditorFocus={this.editorFocusHandler.bind(this)}
|
||||
onSplitUpdate={this.splitUpdateHandler.bind(this)}
|
||||
/>
|
||||
<div class="global-console-container" id="globalConsoleContainerEl" />
|
||||
|
||||
<Footer
|
||||
prefs={this.state.prefs}
|
||||
layoutBtnClickHandler={this.layoutBtnClickHandler.bind(this)}
|
||||
|
Reference in New Issue
Block a user