Browse Source

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

Removes click handlers when popup is hidden.
master
yanas 8 years ago
parent
commit
71c27f308c
2 changed files with 10 additions and 2 deletions
  1. 2
    2
      modules/UI/util/JitsiPopover.js
  2. 8
    0
      modules/UI/videolayout/RemoteVideo.js

+ 2
- 2
modules/UI/util/JitsiPopover.js View File

69
     };
69
     };
70
 
70
 
71
     /**
71
     /**
72
-     * Hides the popover
72
+     * Hides the popover if not hovered or popover is not shown.
73
      */
73
      */
74
     JitsiPopover.prototype.hide = function () {
74
     JitsiPopover.prototype.hide = function () {
75
         if(!this.elementIsHovered && !this.popoverIsHovered &&
75
         if(!this.elementIsHovered && !this.popoverIsHovered &&
79
     };
79
     };
80
 
80
 
81
     /**
81
     /**
82
-     * Hides the popover.
82
+     * Hides the popover and clears the document elements added by popover.
83
      */
83
      */
84
     JitsiPopover.prototype.forceHide = function () {
84
     JitsiPopover.prototype.forceHide = function () {
85
         $(".jitsipopover").remove();
85
         $(".jitsipopover").remove();

+ 8
- 0
modules/UI/videolayout/RemoteVideo.js View File

105
         // call the original show, passing its actual this
105
         // call the original show, passing its actual this
106
         origShowFunc.call(this.popover);
106
         origShowFunc.call(this.popover);
107
     }.bind(this);
107
     }.bind(this);
108
+
109
+    // override popover hide method so we can cleanup click handlers
110
+    let origHideFunc = this.popover.forceHide;
111
+    this.popover.forceHide = function () {
112
+        $(document).off("click", '#mutelink_' + this.id);
113
+        $(document).off("click", '#ejectlink_' + this.id);
114
+        origHideFunc.call(this.popover);
115
+    }.bind(this);
108
 };
116
 };
109
 
117
 
110
 /**
118
 /**

Loading…
Cancel
Save