Skip to content

Commit

Permalink
Docs: Fix white flash on iframe load for Safari (#29419)
Browse files Browse the repository at this point in the history
* Docs: Fix white flash on iframe load for Safari

* Fix white page for root level /docs page (when no page is selected)

* Update index.html

Fix code style.

* Remove unnecessary error event listener

---------

Co-authored-by: Michael Herzog <michael.herzog@human-interactive.org>
  • Loading branch information
JeremyJaydan and Mugen87 authored Sep 17, 2024
1 parent 09f1c61 commit 3fa40fe
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -529,17 +529,23 @@ <h1><a href="https://threejs.org">three.js</a></h1>
const oldIframe = iframe;
iframe = oldIframe.cloneNode();

iframe.style.display = 'none';

if ( hash && titles[ splitHash[ 0 ] ] ) {

iframe.onload = function () {

iframe.style.display = 'unset';

};

iframe.src = splitHash[ 0 ] + '.html' + splitHash[ 1 ];
subtitle = titles[ splitHash[ 0 ] ] + splitHash[ 1 ] + ' – ';
iframe.style.display = 'unset';

} else {

iframe.src = '';
subtitle = '';
iframe.style.display = 'none';

}

Expand Down

0 comments on commit 3fa40fe

Please sign in to comment.