Continuing the discussion from Is it appropriate to use the CommandRegistry for native DOM events like mousedown?:
Ok that makes sense, I see how we can’t reuse CommandRegistry in this case. But it does still seem to me that an EventsRegistry would be really useful, especially in a plugin oriented project such as Atom.
Right now I’m running into a problem implementing Drag and Drop in my view. The problem is that window-event-handler.coffee
is listening for drag and drop. I’m using my own Event delegate class internally, so my handlers are also listening on document… and window-event-handler.coffee
is getting priority since it registers first.
I can solve the problem by adding listeners on my element instance, but that makes everything much more complicated. Since now I need to mange registrations per instance.
It seems to me that everything would be much cleaner if Atom provided and used internally a delegate pattern EventRegistry just as it’s now using the CommandRegistery.
Can you describe a bit more about: “involved pretty severe intervention in the browser’s native event cascade mechanism”. Wouldn’t this just be another implementation (opt in) of the event delegate pattern as used in other frameworks?
It seems to me that it would have a very similar implementing to the existing CommandRegistry.
Thanks,
Jesse