Skip to content

Commit a43519d

Browse files
save file
1 parent 3a042cf commit a43519d

1 file changed

Lines changed: 10 additions & 5 deletions

File tree

utils/misc/nodejs-terminal/v2.0/nodejs-terminal-v2.0.html

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -290,26 +290,31 @@
290290

291291
btn['snippet-editor'] = async function(){
292292

293-
var wciframe = await btn.niframe();
293+
var node = document.createElement('view-port');
294+
node.toggleAttribute('component',true);
295+
document.body.append(node);
296+
var mod2 = mod.create({mod,name:'view-port'});
297+
var result = await mod.build({root:node,mod:mod2});
298+
var viewport = mod2['view-port'];
299+
await mod2.auto();
294300

295301
var node = document.createElement('snippet-editor');
296302
node.toggleAttribute('component',true);
297-
//document.body.append(node);
298-
wciframe.iframe.contentDocument.body.append(node);
303+
viewport.body.append(node);
299304
var mod2 = mod.create({mod,name:'snippet-editor'});
300305
var result = await mod.build({root:node,mod:mod2});
301306
var snippet = mod2['snippet-editor'];
302307
await mod2.auto();
308+
viewport.css('snippet-editor {height:100%}');
303309

304310

305311
var node = document.createElement('webcontainer-fs');
306312
node.setAttribute('component','page');
307-
wciframe.iframe.contentDocument.body.append(node);
313+
viewport.body.append(node);
308314
var mod2 = mod.create({mod,name:'webcontainer-fs'});
309315
var result = await mod.build({root:node,mod:mod2});
310316
var wcfs = mod2['webcontainer-fs'];
311317
wcfs.initmod({filemod:snippet.filemod,ext,$,menu,source,webcontainer,log,debug,complete});
312-
313318
await wcfs.init();
314319
wcfs.initdom();
315320

0 commit comments

Comments
 (0)