Skip to content

Commit

Permalink
Fix popover on fullscreen. See Wirecloud#232
Browse files Browse the repository at this point in the history
  • Loading branch information
aarranz authored and Alejandro Rodriguez committed Jul 24, 2017
1 parent b5ba53e commit d97ddbf
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/wirecloud/commons/static/js/StyledElements/Popover.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,10 @@
content: this.options.content
}).elements[0];
this.element.addEventListener('transitionend', _hide.bind(this));
document.body.appendChild(this.element);

document.addEventListener("click", this._disableCallback, true);
var baseelement = utils.getFullscreenElement() || document.body;
baseelement.appendChild(this.element);
baseelement.addEventListener("click", this._disableCallback, true);

searchBestPosition.call(this, refPosition, this.options.placement);
this.element.classList.add('in');
Expand Down Expand Up @@ -196,7 +197,7 @@

var _hide = function _hide() {
if (this.element != null && !this.element.classList.contains('in')) {
document.body.removeChild(this.element);
this.element.remove();
this.element = null;
if ('Wirecloud' in window) {
Wirecloud.UserInterfaceManager._unregisterPopup(this);
Expand Down

0 comments on commit d97ddbf

Please sign in to comment.