Merge pull request #1155 from jitsi/removes-click-listeners

Removes click handlers when popup is hidden.
This commit is contained in:
yanas 2016-11-22 17:33:30 -06:00 committed by GitHub
commit 71c27f308c
2 changed files with 10 additions and 2 deletions

View File

@ -69,7 +69,7 @@ var JitsiPopover = (function () {
};
/**
* Hides the popover
* Hides the popover if not hovered or popover is not shown.
*/
JitsiPopover.prototype.hide = function () {
if(!this.elementIsHovered && !this.popoverIsHovered &&
@ -79,7 +79,7 @@ var JitsiPopover = (function () {
};
/**
* Hides the popover.
* Hides the popover and clears the document elements added by popover.
*/
JitsiPopover.prototype.forceHide = function () {
$(".jitsipopover").remove();

View File

@ -105,6 +105,14 @@ RemoteVideo.prototype._initPopupMenu = function (popupMenuElement) {
// call the original show, passing its actual this
origShowFunc.call(this.popover);
}.bind(this);
// override popover hide method so we can cleanup click handlers
let origHideFunc = this.popover.forceHide;
this.popover.forceHide = function () {
$(document).off("click", '#mutelink_' + this.id);
$(document).off("click", '#ejectlink_' + this.id);
origHideFunc.call(this.popover);
}.bind(this);
};
/**