EventRunner.js

EventRunner is a utility object that will handle Event with jQuery.data().  All mehtods/properties exist STATIC on EventRunner object.

License

MIT-style license.

Author

Takashi Mizohata bea.nosp@m.tak@nydd.nosp@m..org

Copyright

2008 [nydd](http://code.nydd.org/).

Summary
EventRunner.jsEventRunner is a utility object that will handle Event with jQuery.data().
Variables
MAX_DEPTHMaximum depth for ascending dom tree when the event performs.
Functions
ascendEventif the given elm has event, will perform, otherwise ascend DOM tree recursively.
performThie will execute the method or return values which are associated with the given element and event.
receiveEventIf currentTarget is propery set (in Firefox and Safari), will execute the method right away, if not (in IE) will ascend DOMNode recursively.
registerWrapping event dispatching into EventRunner framwork.
scopewill return fixed context for given function.

Variables

MAX_DEPTH

EventRunner.MAX_DEPTH

Maximum depth for ascending dom tree when the event performs.  Default depth is 5.

Functions

ascendEvent

EventRunner.ascendEvent = function (ev,
elm,
counter)

if the given elm has event, will perform, otherwise ascend DOM tree recursively.

Arguments

ev(DOMEvent)
elm(DOMNode)
counter(uint)

Return

(undef)

perform

EventRunner.perform = function (elm,
ev)

Thie will execute the method or return values which are associated with the given element and event.

Arguments

elm(DOMNode)
ev(DOMEvent)

Return

(*) Object if the event method found and executed, or variable associated with the given event, or false if nothing is associated with the given event

receiveEvent

EventRunner.receiveEvent = function (ev)

If currentTarget is propery set (in Firefox and Safari), will execute the method right away, if not (in IE) will ascend DOMNode recursively.

Arguments

ev(DOMEvent)

Return

(undef)

register

EventRunner.register = function (dom,
type,
func,
context)

Wrapping event dispatching into EventRunner framwork.

Arguments

dom(DOMNode)
type(String)
func(Function)
context(Object)

Return

(undef)

scope

EventRunner.scope = function (target,
func)

will return fixed context for given function.  Equvalent to Fucnction.bind() in prototype.js.

Arguments

target(Object)
func(Function)

Return

(undef)

EventRunner.MAX_DEPTH
Maximum depth for ascending dom tree when the event performs.
EventRunner.ascendEvent = function (ev,
elm,
counter)
if the given elm has event, will perform, otherwise ascend DOM tree recursively.
EventRunner.perform = function (elm,
ev)
Thie will execute the method or return values which are associated with the given element and event.
EventRunner.receiveEvent = function (ev)
If currentTarget is propery set (in Firefox and Safari), will execute the method right away, if not (in IE) will ascend DOMNode recursively.
EventRunner.register = function (dom,
type,
func,
context)
Wrapping event dispatching into EventRunner framwork.
EventRunner.scope = function (target,
func)
will return fixed context for given function.
Close