Browse Source

Merge pull request #1083 from jitsi/fix_hover_thumbnail

fix(Thubmnail_PopupMenu): the thumbnail should be considered hovered when the popup menu is hovered
master
Дамян Минков 9 years ago
parent
commit
d2f52b534a
2 changed files with 23 additions and 0 deletions
  1. 5
    0
      modules/UI/util/JitsiPopover.js
  2. 18
    0
      modules/UI/videolayout/RemoteVideo.js

+ 5
- 0
modules/UI/util/JitsiPopover.js View File

83
     JitsiPopover.prototype.forceHide = function () {
83
     JitsiPopover.prototype.forceHide = function () {
84
         $(".jitsipopover").remove();
84
         $(".jitsipopover").remove();
85
         this.popoverShown = false;
85
         this.popoverShown = false;
86
+        if(this.popoverIsHovered) { //the browser is not firing hover events
87
+            //when the element was on hover if got removed.
88
+            this.popoverIsHovered = false;
89
+            this.onHoverPopover(this.popoverIsHovered);
90
+        }
86
     };
91
     };
87
 
92
 
88
     /**
93
     /**

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

34
     this.bindHoverHandler();
34
     this.bindHoverHandler();
35
     this.flipX = false;
35
     this.flipX = false;
36
     this.isLocal = false;
36
     this.isLocal = false;
37
+    this.popupMenuIsHovered = false;
37
     /**
38
     /**
38
      * The flag is set to <tt>true</tt> after the 'onplay' event has been
39
      * The flag is set to <tt>true</tt> after the 'onplay' event has been
39
      * triggered on the current video element. It goes back to <tt>false</tt>
40
      * triggered on the current video element. It goes back to <tt>false</tt>
89
     };
90
     };
90
     let element = $("#" + this.videoSpanId + " .remotevideomenu");
91
     let element = $("#" + this.videoSpanId + " .remotevideomenu");
91
     this.popover = new JitsiPopover(element, options);
92
     this.popover = new JitsiPopover(element, options);
93
+    this.popover.addOnHoverPopover(isHovered => {
94
+        this.popupMenuIsHovered = isHovered;
95
+        this.updateView();
96
+    });
92
 
97
 
93
     // override popover show method to make sure we will update the content
98
     // override popover show method to make sure we will update the content
94
     // before showing the popover
99
     // before showing the popover
102
     }.bind(this);
107
     }.bind(this);
103
 };
108
 };
104
 
109
 
110
+/**
111
+ * Checks whether current video is considered hovered. Currently it is hovered
112
+ * if the mouse is over the video, or if the connection indicator or the popup
113
+ * menu is shown(hovered).
114
+ * @private
115
+ * NOTE: extends SmallVideo's method
116
+ */
117
+RemoteVideo.prototype._isHovered = function () {
118
+    let isHovered = SmallVideo.prototype._isHovered.call(this)
119
+        || this.popupMenuIsHovered;
120
+    return isHovered;
121
+};
122
+
105
 /**
123
 /**
106
  * Generates the popup menu content.
124
  * Generates the popup menu content.
107
  *
125
  *

Loading…
Cancel
Save