浏览代码

fix(MessageHandler): suppress the notifications on top of the overlay

master
paweldomas 8 年前
父节点
当前提交
210605d8f3

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

@@ -1450,12 +1450,15 @@ UI.hideRingOverLay = function () {
1450 1450
 };
1451 1451
 
1452 1452
 /**
1453
- * Indicates if the ring overlay is currently visible.
1453
+ * Indicates if any the "top" overlays are currently visible. The check includes
1454
+ * the call overlay, GUM permissions overlay and a page reload overlay.
1454 1455
  *
1455
- * @returns {*|boolean} {true} if the ring overlay is visible, {false} otherwise
1456
+ * @returns {*|boolean} {true} if the overlay is visible, {false} otherwise
1456 1457
  */
1457
-UI.isRingOverlayVisible = function () {
1458
-    return RingOverlay.isVisible();
1458
+UI.isOverlayVisible = function () {
1459
+    return RingOverlay.isVisible()
1460
+        || PageReloadOverlay.isVisible()
1461
+        || GumPermissionsOverlay.isVisible();
1459 1462
 };
1460 1463
 
1461 1464
 /**

+ 9
- 1
modules/UI/gum_overlay/UserMediaPermissionsGuidanceOverlay.js 查看文件

@@ -23,6 +23,14 @@ function buildOverlayHtml(browser) {
23 23
 }
24 24
 
25 25
 export default {
26
+    /**
27
+     * Checks whether the overlay is currently visible.
28
+     * @return {boolean} <tt>true</tt> if the overlay is visible
29
+     * or <tt>false</tt> otherwise.
30
+     */
31
+    isVisible () {
32
+        return $overlay && $overlay.parents('body').length > 0;
33
+    },
26 34
     /**
27 35
      * Shows browser-specific overlay with guidance how to proceed with
28 36
      * gUM prompt.
@@ -32,7 +40,7 @@ export default {
32 40
     show(browser) {
33 41
         !$overlay && buildOverlayHtml(browser);
34 42
 
35
-        !$overlay.parents('body').length && $overlay.appendTo('body');
43
+        !this.isVisible() && $overlay.appendTo('body');
36 44
     },
37 45
 
38 46
     /**

+ 9
- 1
modules/UI/reload_overlay/PageReloadOverlay.js 查看文件

@@ -86,6 +86,14 @@ function start(timeoutSeconds) {
86 86
 }
87 87
 
88 88
 export default {
89
+    /**
90
+     * Checks whether the page reload overlay has been displayed.
91
+     * @return {boolean} <tt>true</tt> if the page reload overlay is currently
92
+     * visible or <tt>false</tt> otherwise.
93
+     */
94
+    isVisible() {
95
+        return $overlay && $overlay.parents('body').length > 0;
96
+    },
89 97
     /**
90 98
      * Shows the page reload overlay which will do the conference reload after
91 99
      * the given amount of time.
@@ -97,7 +105,7 @@ export default {
97 105
 
98 106
         !$overlay && buildReloadOverlayHtml();
99 107
 
100
-        if (!$overlay.parents('body').length) {
108
+        if (!this.isVisible()) {
101 109
             $overlay.appendTo('body');
102 110
             start(timeoutSeconds);
103 111
         }

+ 1
- 1
modules/UI/util/MessageHandler.js 查看文件

@@ -333,7 +333,7 @@ var messageHandler = {
333 333
                      messageArguments, options) {
334 334
 
335 335
         // If we're in ringing state we skip all toaster notifications.
336
-        if(!notificationsEnabled || APP.UI.isRingOverlayVisible())
336
+        if(!notificationsEnabled || APP.UI.isOverlayVisible())
337 337
             return;
338 338
 
339 339
         var displayNameSpan = '<span class="nickname" ';

正在加载...
取消
保存