Skip to content

Commit

Permalink
Merge pull request #32 from fomkin/feat/fix-create-element-ns
Browse files Browse the repository at this point in the history
fix #29: allow to create element dynamically
  • Loading branch information
evanplaice authored Nov 12, 2021
2 parents 0fb339d + 17d0e78 commit 0d9e942
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/wc-codemirror.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,17 @@ export class WCCodeMirror extends HTMLElement {

constructor () {
super()
const template = document.createElement('template')
template.innerHTML = WCCodeMirror.template()
this.appendChild(template.content.cloneNode(true))
this.__initialized = false
this.__element = null
this.editor = null
}

async connectedCallback () {
// Create template
const template = document.createElement('template')
template.innerHTML = WCCodeMirror.template()
this.appendChild(template.content.cloneNode(true))
// Initialization
this.style.display = 'block'
this.__element = this.querySelector('textarea')

Expand Down

0 comments on commit 0d9e942

Please sign in to comment.