[Proto-Scripty] Re: Event.stop with two observers on same object
OK, I read those two points on Event#stop, but still believed Event#stop would prevent any further event processing, as the method name indicates. Maybe a clarifying line in the docs would help here, e.g. Note: further observers on the same element will be called despite Event#stop. Steffen On Jun 16, 3:38 pm, T.J. Crowder t...@crowdersoftware.com wrote: Hi, Interesting question. It's the expected behavior. The documentation [1] says that Event#stop will: * Prevent further bubbling of the event * Prevent the default behavior of the event (where the browser allows it) Not triggering other observers doesn't fall under either of those categories. It would also create a non-deterministic situation (since neither browsers nor Prototype guarantee the order in which event handlers are called). It would also be cross-talk (since your handler doesn't necessarily have anything to do with other handlers on the element), which is usually a bad idea, although I think a successful argument could be made that preventing bubbling also creates a cross- talk situation. :-) [1]http://prototypejs.org/api/event/stop HTH, --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Event.stop with two observers on same object
Maybe a clarifying line in the docs would help here, e.g. I'm with you; open a ticket on Lighthouse[1] and assign it to me? [1] https://prototype.lighthouseapp.com/projects/8886-prototype/overview -- T.J. :-) On Jun 17, 8:33 am, steffenb sbart...@tzi.de wrote: OK, I read those two points on Event#stop, but still believed Event#stop would prevent any further event processing, as the method name indicates. Maybe a clarifying line in the docs would help here, e.g. Note: further observers on the same element will be called despite Event#stop. Steffen On Jun 16, 3:38 pm, T.J. Crowder t...@crowdersoftware.com wrote: Hi, Interesting question. It's the expected behavior. The documentation [1] says that Event#stop will: * Prevent further bubbling of the event * Prevent the default behavior of the event (where the browser allows it) Not triggering other observers doesn't fall under either of those categories. It would also create a non-deterministic situation (since neither browsers nor Prototype guarantee the order in which event handlers are called). It would also be cross-talk (since your handler doesn't necessarily have anything to do with other handlers on the element), which is usually a bad idea, although I think a successful argument could be made that preventing bubbling also creates a cross- talk situation. :-) [1]http://prototypejs.org/api/event/stop HTH, --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Event.stop with two observers on same object
Hi, Interesting question. It's the expected behavior. The documentation [1] says that Event#stop will: * Prevent further bubbling of the event * Prevent the default behavior of the event (where the browser allows it) Not triggering other observers doesn't fall under either of those categories. It would also create a non-deterministic situation (since neither browsers nor Prototype guarantee the order in which event handlers are called). It would also be cross-talk (since your handler doesn't necessarily have anything to do with other handlers on the element), which is usually a bad idea, although I think a successful argument could be made that preventing bubbling also creates a cross- talk situation. :-) [1] http://prototypejs.org/api/event/stop HTH, -- T.J. Crowder tj / crowder software / com Independent Software Engineer, consulting services available On Jun 16, 10:18 am, steffenb sbart...@tzi.de wrote: Hi, as it isn't documented, I was wondering if this is the intended behavior: when registering two separate event observers on one object, Event.stop doesn't prevent the second one from firing. Test case: http://pastie.org/513548 Steffen --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---