diff --git a/src/app/components/swap-panel-component.js b/src/app/components/swap-panel-component.js index 49f3ddfd6f..d17a11665c 100644 --- a/src/app/components/swap-panel-component.js +++ b/src/app/components/swap-panel-component.js @@ -27,13 +27,13 @@ class SwapPanelComponent { } add (moduleName, content) { - this.contents[moduleName] = yo`
${content}
` + this.contents[moduleName] = yo`
${content}
` this.view.appendChild(this.contents[moduleName]) } remove (moduleName) { - var el = this.view.querySelector(`div#${moduleName}Content`) - el.parentElement.removeChild(el) + let el = this.contents[moduleName] + if (el) el.parentElement.removeChild(el) } render () { diff --git a/src/app/components/vertical-icons-component.js b/src/app/components/vertical-icons-component.js index b2011f2472..82afd2ac72 100644 --- a/src/app/components/vertical-icons-component.js +++ b/src/app/components/vertical-icons-component.js @@ -12,16 +12,18 @@ class VerticalIconComponent { constructor () { this.event = new EventEmmitter() + this.icons = {} } addIcon (mod) { let self = this - this.view.appendChild(yo`
{ self._iconClick(mod.name) }} title=${mod.name}>${mod.name}
`) + this.icons[mod.name] = yo`
{ self._iconClick(mod.name) }} title=${mod.name}>${mod.name}
` + this.view.appendChild(this.icons[mod.name]) } removeIcon (mod) { - var el = this.view.querySelector(`#${mod.name}Icon`) - el.parentElement.removeChild(el) + let el = this.icons[mod.name] + if (el) el.parentElement.removeChild(el) } select (name) {