Skip to content

Commit

Permalink
Adding extra styles to the heartbeat div to make it not affect layout…
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanolson committed Oct 30, 2015
1 parent 8d87df6 commit c5cb263
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions js/Sim.js
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,14 @@ define( function( require ) {
// for preventing Safari from going to sleep. see https://github.com/phetsims/joist/issues/140
var heartbeatDiv = this.heartbeatDiv = document.createElement( 'div' );
heartbeatDiv.style.opacity = 0;
// Extra style (also used for accessibility) that makes it take up no visual layout space.
// Without this, it could cause some layout issues. See https://github.com/phetsims/gravity-force-lab/issues/39
heartbeatDiv.style.position = 'absolute';
heartbeatDiv.style.left = '0';
heartbeatDiv.style.top = '0';
heartbeatDiv.style.width = '0';
heartbeatDiv.style.height = '0';
heartbeatDiv.style.clip = 'rect(0,0,0,0)';
document.body.appendChild( heartbeatDiv );

if ( phet.chipper.getQueryParameter( 'sceneryLog' ) ) {
Expand Down

0 comments on commit c5cb263

Please sign in to comment.