This commit is contained in:
Alex Yatskov 2016-04-22 21:01:39 -07:00
parent 77e404bbda
commit 85594f4def

View File

@ -28,6 +28,7 @@ class Popup {
this.popup.style.left = pos.x + 'px'; this.popup.style.left = pos.x + 'px';
this.popup.style.top = pos.y + 'px'; this.popup.style.top = pos.y + 'px';
this.popup.style.visibility = 'visible';
this.setContent(content); this.setContent(content);
} }
@ -50,12 +51,15 @@ class Popup {
this.popup.style.left = pos.x + 'px'; this.popup.style.left = pos.x + 'px';
this.popup.style.top = pos.y + 'px'; this.popup.style.top = pos.y + 'px';
this.popup.style.visibility = 'visible';
this.setContent(content); this.setContent(content);
} }
hide() { hide() {
this.remove(); if (this.popup !== null) {
this.popup.style.visibility = 'hidden';
}
} }
setContent(content) { setContent(content) {
@ -76,11 +80,4 @@ class Popup {
document.body.appendChild(this.popup); document.body.appendChild(this.popup);
} }
remove() {
if (this.popup !== null) {
this.popup.parentNode.removeChild(this.popup);
this.popup = null;
}
}
} }