Custom events are now namespaced; "contentloaded" is now "dom:loaded"

24 views
Skip to first unread message

Sam Stephenson

unread,
Oct 11, 2007, 3:36:25 PM10/11/07
to prototy...@googlegroups.com
A small but important change was made to custom events in [7835] (http://dev.rubyonrails.org/changeset/7835
): all custom event names must now include a namespace. This is our
solution to the problem of custom event names conflicting with non-
standard native DOM events, such as "mousewheel" and "DOMMouseScroll."

Prior to this change, Prototype treated only the event names present
in the Event.DOMEvents array as native DOM events. Now, Prototype
looks for the presence of the namespace delimiter -- a single colon --
to determine whether you're observing a custom event or a native event.

You'll need to update any code that uses 1.6.0_rc0's "contentloaded"
event to use its new name, "dom:loaded." You'll also need to give
namespaces to any other custom events you may be firing or observing.
We suggest using singular nouns for namespaces, and past-tense verbs
for the event names (e.g. "effect:queued", "widget:activated", and so
on).

-sam

Reply all
Reply to author
Forward
0 new messages