Selaa lähdekoodia

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

Fix the black stripe (another try)
j8
lyubomir 9 vuotta sitten
vanhempi
commit
28bac7b329

+ 1
- 1
modules/UI/side_pannels/chat/Chat.js Näytä tiedosto

@@ -315,7 +315,7 @@ var Chat = {
315 315
      * Indicates if the chat is currently visible.
316 316
      */
317 317
     isVisible () {
318
-        return $('#chatspace').is(":visible");
318
+        return UIUtil.isVisible(document.getElementById("chatspace"));
319 319
     },
320 320
     /**
321 321
      * Shows and hides the window with the smileys

+ 2
- 1
modules/UI/side_pannels/contactlist/ContactList.js Näytä tiedosto

@@ -1,6 +1,7 @@
1 1
 /* global $, APP */
2 2
 import Avatar from '../../avatar/Avatar';
3 3
 import UIEvents from '../../../../service/UI/UIEvents';
4
+import UIUtil from '../../util/UIUtil';
4 5
 
5 6
 let numberOfContacts = 0;
6 7
 let notificationInterval;
@@ -87,7 +88,7 @@ var ContactList = {
87 88
      * otherwise
88 89
      */
89 90
     isVisible () {
90
-        return $('#contactlist').is(":visible");
91
+        return UIUtil.isVisible(document.getElementById("contactlist"));
91 92
     },
92 93
 
93 94
     /**

+ 1
- 1
modules/UI/side_pannels/settings/SettingsMenu.js Näytä tiedosto

@@ -161,7 +161,7 @@ export default {
161 161
      * @returns {boolean}
162 162
      */
163 163
     isVisible () {
164
-        return $('#settingsmenu').is(':visible');
164
+        return UIUtil.isVisible(document.getElementById("settingsmenu"));
165 165
     },
166 166
 
167 167
     /**

+ 12
- 1
modules/UI/util/UIUtil.js Näytä tiedosto

@@ -155,7 +155,18 @@
155 155
          return Object.keys(attrs).map(
156 156
              key => ` ${key}="${attrs[key]}"`
157 157
          ).join(' ');
158
-     }
158
+     },
159
+
160
+    /**
161
+     * Checks if the given DOM element is currently visible. The offsetParent
162
+     * will be null if the "display" property of the element or any of its
163
+     * parent containers is set to "none". This method will NOT check the
164
+     * visibility property though.
165
+     * @param {el} The DOM element we'd like to check for visibility
166
+     */
167
+    isVisible(el) {
168
+        return (el.offsetParent !== null);
169
+    }
159 170
 };
160 171
 
161 172
 export default UIUtil;

Loading…
Peruuta
Tallenna