Closed jhelbert closed 10 years ago
Why does the context menu need access to the data provider? It seems like the data provider should depend on the context menu and use a function to add itself to the context menu.
@jhelbert status on this?
Press 'm' to toggle the context menu on and off.
Selected Node Count Expand Nodes Button
call ContextMenu.addMenuOption: (menuText, itemFunction, that)
menuText- text that will appear
itemFunction- function to be executed when context menu section is clicked
that- instance of class (needed due to binding issues)
dataProvider = instances["local/ExampleDataProvider"] ContextMenu.addMenuOption "Expand Nodes", dataProvider.addRelatedNodes, dataProvider
i tried putting this in with the latest on celestrium-example's random page and on page load it just appears like this
pressing m
just changes the location of the "nodes selected" message, it doesn't turn it off.
@jhelbert can you point me to a working implementation using this code?
here is a working implementation https://github.com/jhelbert/github_collaborators
pulling celestrium-example now to see why it isn't working there...
@haosharon I am running into problems with circular dependencies, Joe said you were dealing with something similar?
For me, the ContextMenu plugin needs to access the DataProvider instance (which would mean the dataprovider would need to be listed first in main.coffee), but DataProvider calls a ContextMenu function as well.