From 9db892198ef0116beb7a81d810c0e86c51f745dd Mon Sep 17 00:00:00 2001 From: bat Date: Thu, 16 Mar 2023 16:59:31 +0000 Subject: [PATCH] Actualizar 'components/page.js' --- components/page.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/components/page.js b/components/page.js index 8fb37b2..5a907cb 100644 --- a/components/page.js +++ b/components/page.js @@ -36,11 +36,9 @@ export class Page extends HTMLElement { super() const shadow = this.attachShadow({mode: 'open'}) this.textArea = document.createElement('textarea') - this.header = document.createElement('h1') this.textArea.addEventListener('input', e => { - const path = this.getAttribute('path') localStorage.setItem( - path, + this.path, e.target.value ) }) @@ -51,10 +49,9 @@ export class Page extends HTMLElement { } connectedCallback() { - const path = this.getAttribute('path') this.header.innerText = path this.textArea.value = localStorage.getItem( - path + this.path ) ?? '' const style = document.createElement('style') style.textContent = ` @@ -64,8 +61,11 @@ export class Page extends HTMLElement { font-family: sans-serif; } textarea { - width: 94vw; - height: 45vh; + width: 100%; + margin: 0 5px; + padding: 5px; + + height: 50vh; } iframe { border: none; @@ -74,7 +74,7 @@ export class Page extends HTMLElement { } ` this.shadowRoot.append(style) - if (path.startsWith('/sandbox/')) { + if (this.path.startsWith('/sandbox/')) { this.initFrame() } }