Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/scenemanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function SceneManager(p)
for(var i = 0; i < P5Events.length; i++)
{
let sEvent = P5Events[i]; // let is necesary to set the scope at the level of for
o[sEvent] = function() { me.handleEvent(sEvent) };
o[sEvent] = function() { me.handleEvent(sEvent, [].slice.call(arguments)) };
}

return me;
Expand Down Expand Up @@ -179,14 +179,14 @@ function SceneManager(p)

// Handle a certain even for a scene...
// It is used by the anonymous functions from the wire() function
this.handleEvent = function(sEvent)
this.handleEvent = function(sEvent, args)
{
if ( this.scene == null || this.scene.oScene == null )
return;

var fnSceneEvent = this.scene.oScene[sEvent];
if (fnSceneEvent)
fnSceneEvent.call(this.scene.oScene);
fnSceneEvent.apply(this.scene.oScene, args);
}

// Legacy method... preserved for maintaining compatibility
Expand Down