1
0
Эх сурвалжийг харах

Logical like #169, move the judgment code to toggle

Karl Chen 7 жил өмнө
parent
commit
018ed245d6
1 өөрчлөгдсөн 15 нэмэгдсэн , 2 устгасан
  1. 15 2
      src/fullscreen.js

+ 15 - 2
src/fullscreen.js

@@ -92,9 +92,22 @@ class FullScreen {
             this.cancel(type);
         }
         else {
-            this.request(type);
+            switch (type) {
+            case 'browser':
+                this.request('browser');
+                if (this.isFullScreen('web')) {
+                    this.cancel('web');
+                }
+                break;
+            case 'web':
+                this.request('web');
+                if (this.isFullScreen('browser')) {
+                    this.cancel('browser');
+                }
+                break;
+            }
         }
     }
 }
 
-module.exports = FullScreen;
+module.exports = FullScreen;