WIP
This commit is contained in:
parent
77e404bbda
commit
85594f4def
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user