Browse Source

Merge pull request #591 from jitsi/fix-black-stripe

Fix black stripe and side panel animations
j8
damencho 9 years ago
parent
commit
a112b10a36
2 changed files with 18 additions and 7 deletions
  1. 1
    1
      css/main.css
  2. 17
    6
      modules/UI/side_pannels/SidePanelToggler.js

+ 1
- 1
css/main.css View File

@@ -20,7 +20,7 @@ html, body{
20 20
     top: 0px;
21 21
     bottom: 0px;
22 22
     right: 0px;
23
-    width: 20%;
23
+    width: 0px;
24 24
     max-width: 200px;
25 25
     overflow: hidden;
26 26
     /* background-color:#dfebf1;*/

+ 17
- 6
modules/UI/side_pannels/SidePanelToggler.js View File

@@ -38,13 +38,18 @@ function toggle (object, selector, onOpenComplete,
38 38
             queue: false,
39 39
             duration: 500
40 40
         });
41
+
41 42
         $(selector).hide("slide", {
42 43
             direction: "right",
43 44
             queue: false,
44
-            duration: 500
45
+            duration: 500,
46
+            // Set the size to 0 at the end of the animation to ensure that
47
+            // the is(":visible") function on this selector will return {false}
48
+            // when the element is hidden.
49
+            complete: function() {$(selector).css("width", "0");}
45 50
         });
46 51
 
47
-        resizeVideoArea(isSideBarVisible, onVideoResizeComplete);
52
+        resizeVideoArea(false, onVideoResizeComplete);
48 53
 
49 54
         if(typeof onClose === "function") {
50 55
             onClose();
@@ -52,7 +57,7 @@ function toggle (object, selector, onOpenComplete,
52 57
 
53 58
         currentlyOpen = null;
54 59
     } else {
55
-        resizeVideoArea(isSideBarVisible, onVideoResizeComplete);
60
+        resizeVideoArea(true, onVideoResizeComplete);
56 61
 
57 62
         // Undock the toolbar when the chat is shown and if we're in a
58 63
         // video mode.
@@ -76,6 +81,12 @@ function toggle (object, selector, onOpenComplete,
76 81
             queue: false,
77 82
             duration: 500
78 83
         });
84
+        // Set the size dynamically (not in the css), so that we're sure that
85
+        // when is(":visible") is called on this selector the result is {false}
86
+        // before it's actually visible.
87
+        // (Chrome seems to return {true} for an element which is in the DOM and
88
+        // has non-null size set).
89
+        $(selector).css("width", "20%");
79 90
         $(selector).show("slide", {
80 91
             direction: "right",
81 92
             queue: false,
@@ -91,9 +102,9 @@ function toggle (object, selector, onOpenComplete,
91 102
 }
92 103
 
93 104
 function resizeVideoArea(isSidePanelVisible, completeFunction) {
94
-    VideoLayout.resizeVideoArea(!isSidePanelVisible,
95
-        false,
96
-        false,
105
+    VideoLayout.resizeVideoArea(isSidePanelVisible,
106
+        false,//don't force thumbnail count update
107
+        true, //animate
97 108
         completeFunction);
98 109
 }
99 110
 

Loading…
Cancel
Save