Ok smart JavaScript people, my assumption is if there were a way to do cross browser event capturing it would have been in Prototype already, correct? So far the only place I have really needed to get the event in the capture phase was when I wanted to get the next click anywhere on the page. It''s for a feature kind of like the "more" dropdown at the top of google.com where once activated the next click anywhere on the page will close the dropdown. The logical thing to do would be document.observe(''click'', function() {}, true). Of course we all know that IE doesn''t support capture and Prototype doesn''t even look at that parameter anymore. So my pre 1.6 "simulation" was to add a method (pause) to Event that saves off all of the current observers and then stop and clear them all. The inverse Event method (resume) restores all of the observers that I stored off. This gave me... Object.extend(Selection.prototype, { initialize: function() { ... Event.pauseCurrentObservers(); Event.observe(document, ''mousedown'', this.close.bind(this)); ... }, close: function() { Event.unloadCache(); Event.resumePausedObservers(); ... }, ... }); I know it''s not true a capturing phase, but it works for my particular use case. All was well until I wanted to upgrade to 1.6 which completely revamps the whole Event model, which btw was for the better. So, I guess my question is, has anyone solved this problem before? Am I missing something obvious that would make this easier? Also, for the Prototype devs, from a quick look through the new Event stuff there doesn''t appear to be a way to get back to the element from the Event.cache entry, correct? Darrin --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Hello Darrin, The issue about getting back to the element has been addressed in a recent patch to the core: http://github.com/sstephenson/prototype/commit/6ff8485e40b8633928bcfda0adc08469b7ea3c16 Please submit any patches or ideas you have they are always welcome :) http://www.prototypejs.org/contribute Also check out some of these event additions by Kangax: http://github.com/kangax/protolicious/tree/master/event.register.js http://github.com/kangax/protolicious/tree/master/event.interceptor.js http://github.com/kangax/protolicious/tree/master/event.simulate.js - JDD --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Having one "master" callback-wrapper would allow us to do so many things: Capturing, correct callback order, a way to prevent/stop other callbacks, interception (based on condition) and others. Need to start mocking that up : ) - kangax On May 7, 5:12 pm, jdalton <John.David.Dal...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hello Darrin, > > The issue about getting back to the element has been addressed in a > recent patch to the core:http://github.com/sstephenson/prototype/commit/6ff8485e40b8633928bcfd... > > Please submit any patches or ideas you have they are always welcome :)http://www.prototypejs.org/contribute > > Also check out some of these event additions by Kangax:http://github.com/kangax/protolicious/tree/master/event.register.jshttp://github.com/kangax/protolicious/tree/master/event.interceptor.jshttp://github.com/kangax/protolicious/tree/master/event.simulate.js > > - JDD--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Yeah, I''ve been thinking about that for the last few days. I got my pause/resume hackery working in 1.6, hopefully I''ll have time to work on the "right" way. On May 8, 6:52 pm, kangax <kan...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Having one "master" callback-wrapper would allow us to do so many > things: > Capturing, correct callback order, a way to prevent/stop other > callbacks, interception (based on condition) and others. > Need to start mocking that up : ) > > - kangax > > On May 7, 5:12 pm, jdalton <John.David.Dal...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hello Darrin, > > > The issue about getting back to the element has been addressed in a > > recent patch to the core:http://github.com/sstephenson/prototype/commit/6ff8485e40b8633928bcfd... > > > Please submit any patches or ideas you have they are always welcome :)http://www.prototypejs.org/contribute > > > Also check out some of these event additions by Kangax:http://github.com/kangax/protolicious/tree/master/event.register.jsht... > > > - JDD--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---