mirror of
https://github.com/pyscript/pyscript.git
synced 2022-05-01 19:47:48 +03:00
cleanup some leftovers in pybox
This commit is contained in:
@@ -5,7 +5,6 @@ export class PyBox extends HTMLElement {
|
|||||||
wrapper: HTMLElement;
|
wrapper: HTMLElement;
|
||||||
theme: string;
|
theme: string;
|
||||||
widths: Array<string>;
|
widths: Array<string>;
|
||||||
// editorState: EditorState;
|
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
super();
|
super();
|
||||||
@@ -21,12 +20,10 @@ export class PyBox extends HTMLElement {
|
|||||||
connectedCallback() {
|
connectedCallback() {
|
||||||
let mainDiv = document.createElement('div');
|
let mainDiv = document.createElement('div');
|
||||||
addClasses(mainDiv, ["flex"])
|
addClasses(mainDiv, ["flex"])
|
||||||
// mainDiv.append(...this.childNodes);
|
|
||||||
|
|
||||||
// Ugly hack: for some reason when moving children, the editor box duplicates children
|
// Hack: for some reason when moving children, the editor box duplicates children
|
||||||
// meaning that we end up with 2 editors, if there's a <py-repl> inside the <py-box>
|
// meaning that we end up with 2 editors, if there's a <py-repl> inside the <py-box>
|
||||||
// so, if we have more than 2 children with the cm-editor class, we remove one of them
|
// so, if we have more than 2 children with the cm-editor class, we remove one of them
|
||||||
|
|
||||||
while (this.childNodes.length > 0) {
|
while (this.childNodes.length > 0) {
|
||||||
console.log(this.firstChild);
|
console.log(this.firstChild);
|
||||||
if ( this.firstChild.nodeName == "PY-REPL" ){
|
if ( this.firstChild.nodeName == "PY-REPL" ){
|
||||||
|
|||||||
Reference in New Issue
Block a user