瀏覽代碼

fix(popover): set display before calculating width

Popover works by first creating a DOM element with display none
then having jquery calculate its width and new position and
then setting display to table. This does not work with p2p
connection stats, which are much wider than the default width
of the popover. What will happen is when display table is set,
the width will increase greatly so the positioning will be off.
The workaround here is to set display table as the default
display but toggle visibility instead.
master
Leonard Kim 8 年之前
父節點
當前提交
0d4b77d7b1
共有 2 個文件被更改,包括 6 次插入5 次删除
  1. 2
    1
      css/_jitsi_popover.scss
  2. 4
    4
      modules/UI/util/JitsiPopover.js

+ 2
- 1
css/_jitsi_popover.scss 查看文件

@@ -3,7 +3,8 @@
3 3
     top: 0;
4 4
     left: 0;
5 5
     z-index: $jitsipopoverZ;
6
-    display: none;
6
+    display: table;
7
+    visibility: hidden;
7 8
     max-width: 300px;
8 9
     min-width: 100px;
9 10
     text-align: left;

+ 4
- 4
modules/UI/util/JitsiPopover.js 查看文件

@@ -36,9 +36,9 @@ const positionConfigurations = {
36 36
             const { element, target } = elements;
37 37
 
38 38
             $('.jitsipopover').css({
39
-                display: 'table',
40 39
                 left: element.left,
41
-                top: element.top
40
+                top: element.top,
41
+                visibility: 'visible'
42 42
             });
43 43
 
44 44
             // Move additional padding to the right edge of the popover and
@@ -72,9 +72,9 @@ const positionConfigurations = {
72 72
             const $jistiPopover = $('.jitsipopover');
73 73
 
74 74
             $jistiPopover.css({
75
-                display: 'table',
76 75
                 left: element.left,
77
-                top: element.top
76
+                top: element.top,
77
+                visibility: 'visible'
78 78
             });
79 79
             $jistiPopover.find('.arrow').css({ left: calcLeft });
80 80
             $jistiPopover.find('.jitsipopover__menu-padding')

Loading…
取消
儲存