Merge pull request #1155 from jitsi/removes-click-listeners
Removes click handlers when popup is hidden.
This commit is contained in:
commit
71c27f308c
|
@ -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();
|
||||
|
|
|
@ -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);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue