Demo: http://codepen.io/anon/pen/rxojXZ
Hi,
I’ve got a context menu that passes in functions of cut copy and paste on a click event, using myDiagram.commandHandler
myDiagram is in scope and is not null, yet I’m getting errors like “this.cutSelection is not a function”, or “Cannot read property ‘selection’ of undefined” while passing the functions as a parameter of another.
var defaultContextMenuButton = function(text, textStyle, myFunction){
return $("ContextMenuButton", {click: myFunction}
....
)}
....
defaultContextMenuButton("Cut", defaultFont, myDiagram.commandHandler.cutSelection);
Any idea why this isn’t working?
Hopefully I’m just being dumb here.