소스 검색

fix(Thubmnail_PopupMenu): the thumbnail should be considered hovered when the popup menu is hovered

j8
hristoterezov 8 년 전
부모
커밋
634a18e847
2개의 변경된 파일23개의 추가작업 그리고 0개의 파일을 삭제
  1. 5
    0
      modules/UI/util/JitsiPopover.js
  2. 18
    0
      modules/UI/videolayout/RemoteVideo.js

+ 5
- 0
modules/UI/util/JitsiPopover.js 파일 보기

@@ -83,6 +83,11 @@ var JitsiPopover = (function () {
83 83
     JitsiPopover.prototype.forceHide = function () {
84 84
         $(".jitsipopover").remove();
85 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 파일 보기

@@ -34,6 +34,7 @@ function RemoteVideo(user, VideoLayout, emitter) {
34 34
     this.bindHoverHandler();
35 35
     this.flipX = false;
36 36
     this.isLocal = false;
37
+    this.popupMenuIsHovered = false;
37 38
     /**
38 39
      * The flag is set to <tt>true</tt> after the 'onplay' event has been
39 40
      * triggered on the current video element. It goes back to <tt>false</tt>
@@ -89,6 +90,10 @@ RemoteVideo.prototype._initPopupMenu = function (popupMenuElement) {
89 90
     };
90 91
     let element = $("#" + this.videoSpanId + " .remotevideomenu");
91 92
     this.popover = new JitsiPopover(element, options);
93
+    this.popover.addOnHoverPopover(isHovered => {
94
+        this.popupMenuIsHovered = isHovered;
95
+        this.updateView();
96
+    });
92 97
 
93 98
     // override popover show method to make sure we will update the content
94 99
     // before showing the popover
@@ -102,6 +107,19 @@ RemoteVideo.prototype._initPopupMenu = function (popupMenuElement) {
102 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 124
  * Generates the popup menu content.
107 125
  *

Loading…
취소
저장