Get parent node object in child node

  • Hi, I'm developing two html5 javascript plugins which has a relationship between them e.g.

    Code
    <plugin name="parentNodePlugin" url="myplugin,js" role="parent">
    	<plugin name="childNodePlugin" url="myotherplugin.js" role="child" >
    	<plugin name="normalPlugin url="something.png">
    </plugin>


    In this example there is a parent/child relationship between childNodePlugin and parentNodePlugin.

    In my plugin code how can in get access to the actual parent object from the child?
    At the moment i can only see a text string with the name of the plugin.
    When i try to use krpano.get() i always get a null returned?

    Code
    local.registerplugin = function(krpanointerface, pluginpath, pluginobject)    {
    	krpano = krpanointerface; 
    	plugin = pluginobject; 
    	console.log(plugin.parent)  // prints out 'parentNodePlugin' from the child node. 
    	console.log(krpano.get(plugin.parent)) // null  from the child node.
        };


    Is there another way or another interface i should use to find the parent node object?

    many thanks
    /Neal

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!