The easiest way to find a βreal OOPβ in this case is to send all events at the document level:
create a simple object and load this object in main and in the form of a view:
var events = {someCustomEventFromMain:'someCustomEventFromMain', someCustomEventFromView:'someCustomEventFromView'}
Now you can fire events in a document using jQuery, for example
$(document).trigger(events.someCustomEventFromMain, somedata);
And you can listen to any view or div or
$(document).on(events.someCustomEventFromMain, function(__e, __data){
So, if each index listens for some event at the document level, in your case "drawEvent", this should do the trick. You can even pass parameters in event data, such as a circle. Hope this helps.
source share