Skip to content

Commit

Permalink
Bugfix: restore canvas/nav visibility if nothing found in `getElement…
Browse files Browse the repository at this point in the history
…FromPoint()`
  • Loading branch information
joshvarner committed Oct 3, 2010
1 parent 059a032 commit d90eed1
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion asteroids.js
Expand Up @@ -454,7 +454,13 @@ function Asteroids() {
that.canvas.style.visibility = "hidden";
that.navigation.style.visibility = "hidden";
var element = document.elementFromPoint(x, y);
if ( ! element ) return false;

if ( ! element ) {
that.canvas.style.visibility = 'visible';
that.navigation.style.visibility = 'visible';
return false;
}

if ( element.nodeType == 3 )
element = element.parentNode;
// show the canvas again, hopefully it didn't blink
Expand Down

0 comments on commit d90eed1

Please sign in to comment.