diff options
author | Alex Yatskov <alex@foosoft.net> | 2016-04-22 21:01:39 -0700 |
---|---|---|
committer | Alex Yatskov <alex@foosoft.net> | 2016-04-22 21:01:39 -0700 |
commit | 85594f4def54d14558415d4594fcf810c26cad75 (patch) | |
tree | 510340d8e50624164f7d7af0dac18ac49ecafac9 /ext/fg/js/popup.js | |
parent | 77e404bbda2336bdd7fa231602239735e56fcc7e (diff) |
WIP
Diffstat (limited to 'ext/fg/js/popup.js')
-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; - } - } } |