- From: Marcos Cáceres <notifications@github.com>
- Date: Wed, 16 Jan 2019 03:09:30 -0800
- To: w3c/screen-orientation <screen-orientation@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <w3c/screen-orientation/pull/134/review/193075436@github.com>
marcoscaceres requested changes on this pull request.
Suggestions we discussed on Slack...
> @@ -554,16 +554,23 @@ <h2>
</button>
</pre>
<p>
- This example waits to be fullscreen before locking the screen
- orientation and starting.
+ This example waits to be fullscreen and locked to landscape before
```suggestion
This example waits for fullscreen, then locks to landscape before
```
> @@ -554,16 +554,23 @@ <h2>
</button>
</pre>
<p>
- This example waits to be fullscreen before locking the screen
- orientation and starting.
+ This example waits to be fullscreen and locked to landscape before
+ running <code>ready()</code>.
```suggestion
calling <code>ready()</code>.
```
> </p>
<pre class='example html'>
<script>
- var start = function() {
- document.onfullscreenchange = function() {
- screen.orientation.lock('natural').then(startInternal);
- }
- document.documentElement.requestFullscreen();
+ function ready(){
+ console.log("Now full screen and ready to start, locked to " + screen.orientation.type);
+ }
+
+ async function start() {
+ const promiseToFullScreen = new Promise(resolve =>
As we discussed, we don't need this anymore :) Similarly if it's still in other examples.
> </p>
<pre class='example html'>
<script>
- var start = function() {
- document.onfullscreenchange = function() {
- screen.orientation.lock('natural').then(startInternal);
- }
- document.documentElement.requestFullscreen();
+ function ready(){
+ console.log("Now full screen and ready to start, locked to " + screen.orientation.type);
+ }
+
+ async function start() {
+ const promiseToFullScreen = new Promise(resolve =>
+ document.addEventListener("fullscreenchange", resolve)
+ );
+ await document.documentElement.requestFullscreen();
+ await promiseToFullScreen;
And this one.
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/screen-orientation/pull/134#pullrequestreview-193075436
Received on Wednesday, 16 January 2019 11:09:51 UTC