From 85594f4def54d14558415d4594fcf810c26cad75 Mon Sep 17 00:00:00 2001 From: Alex Yatskov Date: Fri, 22 Apr 2016 21:01:39 -0700 Subject: [PATCH] WIP --- ext/fg/js/popup.js | 21 +++++++++------------ 1 file 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; - } - } }