diff options
-rw-r--r-- | ext/fg/js/popup.js | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/ext/fg/js/popup.js b/ext/fg/js/popup.js index 003918df..f03a0549 100644 --- a/ext/fg/js/popup.js +++ b/ext/fg/js/popup.js @@ -26,8 +26,9 @@ class Popup { showAt(pos, content) { this.inject(); - this.popup.style.left = pos.x + 'px'; - this.popup.style.top = pos.y + 'px'; + this.popup.style.left = pos.x + 'px'; + this.popup.style.top = pos.y + 'px'; + this.popup.style.visibility = 'visible'; this.setContent(content); } @@ -48,14 +49,17 @@ class Popup { posY = elementRect.top - popupRect.height - this.offset; } - this.popup.style.left = pos.x + 'px'; - this.popup.style.top = pos.y + 'px'; + this.popup.style.left = pos.x + 'px'; + this.popup.style.top = pos.y + 'px'; + this.popup.style.visibility = 'visible'; this.setContent(content); } hide() { - this.remove(); + if (this.popup !== null) { + this.popup.style.visibility = 'hidden'; + } } setContent(content) { @@ -76,11 +80,4 @@ class Popup { document.body.appendChild(this.popup); } - - remove() { - if (this.popup !== null) { - this.popup.parentNode.removeChild(this.popup); - this.popup = null; - } - } } |