Quellcode durchsuchen

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

Fix the black stripe (another try)
j8
lyubomir vor 9 Jahren
Ursprung
Commit
28bac7b329

+ 1
- 1
modules/UI/side_pannels/chat/Chat.js Datei anzeigen

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

+ 2
- 1
modules/UI/side_pannels/contactlist/ContactList.js Datei anzeigen

1
 /* global $, APP */
1
 /* global $, APP */
2
 import Avatar from '../../avatar/Avatar';
2
 import Avatar from '../../avatar/Avatar';
3
 import UIEvents from '../../../../service/UI/UIEvents';
3
 import UIEvents from '../../../../service/UI/UIEvents';
4
+import UIUtil from '../../util/UIUtil';
4
 
5
 
5
 let numberOfContacts = 0;
6
 let numberOfContacts = 0;
6
 let notificationInterval;
7
 let notificationInterval;
87
      * otherwise
88
      * otherwise
88
      */
89
      */
89
     isVisible () {
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 Datei anzeigen

161
      * @returns {boolean}
161
      * @returns {boolean}
162
      */
162
      */
163
     isVisible () {
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 Datei anzeigen

155
          return Object.keys(attrs).map(
155
          return Object.keys(attrs).map(
156
              key => ` ${key}="${attrs[key]}"`
156
              key => ` ${key}="${attrs[key]}"`
157
          ).join(' ');
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
 export default UIUtil;
172
 export default UIUtil;

Laden…
Abbrechen
Speichern