Ariel,
+ 1 for me...Good you found that something needs to be reworked again
there.

A quite similar approach was firstly tested in the "event.fix()"
optimizations in 1.2.3.

At that time my proposal was an "event.create()" function returning an
object but I like your approach, it is probably better, especially if
it offers a consistent solution for both "event.fix()" and
"event.trigger".

The created events (especially for custom and object events) don't
need to have copied all those properties, the type, the 3 targets,
eventPhase, preventDefault() and stopPropagation() and very few extra
properties are the one needed in 99% of the cases, by saving in it a
copy of the "originalEvent" all those properties will be available
anyway (maybe through a getter if that is preferred).

Two suggestions I have for "event.js":

- add the capture flag, W3C specs, so delegation may be wired directly
through existing code
- make a distinction between firing events on DOM elements and
triggering events on objects

Manual firing of events on DOM elements seems to be handled in a more
standard way by native "dispatchEvent()" or "fireEvent()" and you get
the benefit of letting co-existing code know this happened.

jQuery.event meeting Prototype Event ?

--
Diego


On 29 Nov, 01:14, Ariel Flesler <[EMAIL PROTECTED]> wrote:
> Feedback please! :)
>
> I really like (and support) this feature.
>
> http://dev.jquery.com/ticket/3662
>
> Also... I know that the returned value from jQuery.fn.trigger is used
> here and there (jQuery UI?). But that behavior is really odd and
> fragile in my opinion (false overrides any previous value).
>
> I think it'd be nice to return true/false depending on whether
> e.preventDefault() was called. This would be very useful for custom
> events, to allow event handlers to stop a scheduled (custom) behavior.
>
> As an alternative, we could add e.isDefaultPrevented() that retrieves
> this value from the event object.
>
> Note that none of this last 2 behaviors (or the one in the ticket) is
> my invention.
> I'm just imitating AS3's event system. I suppose that belongs to some
> EcmaScript specification as well.
>
> http://docs.brajeshwar.com/as3/flash/events/Event.html
>
> Thanks
>
> --
> Ariel Fleslerhttp://flesler.blogspot.com
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jQuery Development" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to