Skip to content

Commit

Permalink
Set event.target to the real Canvas object
Browse files Browse the repository at this point in the history
  • Loading branch information
phoboslab committed Nov 6, 2012
1 parent a7a9268 commit 10bde0b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ejecta.js
Expand Up @@ -30,6 +30,7 @@ window.navigator = {

// Create the default screen canvas
window.canvas = new Ejecta.Canvas();
window.canvas.type = 'canvas';

// The console object
window.console = {
Expand Down Expand Up @@ -183,7 +184,7 @@ window.canvas.removeEventListener = window.removeEventListener = function( type,
var touchInput = null;
var touchEvent = {
type: 'touchstart',
target: {type:'canvas'},
target: canvas,
touches: [],
preventDefault: function(){},
stopPropagation: function(){}
Expand Down Expand Up @@ -227,7 +228,7 @@ window.document._eventInitializers.touchstart =
var accelerometer = null;
var deviceMotionEvent = {
type: 'devicemotion',
target: {type:'canvas'},
target: canvas,
acceleration: {x: 0, y: 0, z: 0},
accelerationIncludingGravity: {x: 0, y: 0, z: 0},
preventDefault: function(){},
Expand Down

0 comments on commit 10bde0b

Please sign in to comment.