I have inherited some javascript code that I am struggling to work with. I believe I need to 'invoke a function as a method' that is within another 'function as a method'. I have included abridged code below.
drawer = {
...
ChartDrawer: function(var1,var2,etc)
{
...
this.drawChart = function(node)
{
...
$(this.jqValToggle + ' #valuation-box').click(function(){
console.log('clicked');
drawer.valToggle();
var targetNode = addrFromRawAddr(rawAddr)
showNarrative(targetNode);
/// THIS IS WHERE I'D LIKE TO CALL drawChart FROM
});
}
}
Could you please suggest the syntax needed to call 'drawChart' from the location in the code specified above.
I would have thought I could use drawer.ChartDrawer.drawChart(node);
but this gets 'Uncaught TypeError: drawer.ChartDrawer.drawChart is not a function'. I have also tried variations on using 'this.drawChart' with no success