Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

Node's listeners should execute on node scope - remove self param from func signature

#140

Take "picked" listeners for example:

SceneJS.node({
            sid: "alpha",
 
            listeners: {
                "picked":{
                    fn: function(self, params) {
                         alert(self.getSID() + " handling 'picked' event from " + params.uri);
                    }
                }
            }
        },

We dont need the self param - remove it to keep things terse, just fire the listener on the node scope:

SceneJS.node({
            sid: "alpha",
 
            listeners: {
                "picked":{
                    fn: function(params) {
                         alert(this.getSID() + " handling 'picked' event from " + params.uri);
                    }
                }
            }
        },

Reported by lindsay.kay (at xeolabs) · August 7th, 2010 @ 03:02 AM

State: resolved
Milestone: V0.7.7

Activity

  1. lindsay.kay (at xeolabs)
    lindsay.kay (at xeolabs)

    Originally I thought it might be nice to control the scope of the listener the way ExtJS does, but there are other ways to do that, eg. using delegate functions, and the main idea of SceneJS is simplicity first.

    August 7th, 2010 @ 03:06 AM

  2. lindsay.kay (at xeolabs)
    lindsay.kay (at xeolabs)
    • State changed from open to resolved

    August 7th, 2010 @ 03:37 AM

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.