You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
The event argument is not passed for listners attached to a JS object #102
// non-native event, either because of a namespace, arguments or a non DOM element
// iterate over all listeners and manually 'fire'
handlers = registry.get(element, type, null, false)
args = [false].concat(args)
for (j = 0, l = handlers.length; j < l; j++) {
if (handlers[j].inNamespaces(names)) {
handlers[j].handler.apply(element, args)
}
}
To:
// non-native event, either because of a namespace, arguments or a non DOM element
// iterate over all listeners and manually 'fire'
handlers = registry.get(element, type, null, false)
for (j = 0, l = handlers.length; j < l; j++) {
if (handlers[j].inNamespaces(names)) {
handlers[j].handler.apply(element, [false, handlers[j]].concat(args))
}
}
Activity
bartsidee commentedon Jan 28, 2014
A quick solution I just found was to pass the handler as event argument to the event
From https://github.com/fat/bean/blob/master/src/bean.js#L667:
To:
ryanve commentedon Jan 28, 2014
Duplicate of #80 Yes we should fix this.
rvagg commentedon Jan 28, 2014
@ryanve let's just get this done, want to do up a PR to make the needed changes?
ded commentedon Jan 28, 2014
interesting that this only comes up now. what would one do with an event object from a custom event?
ryanve commentedon Jan 28, 2014
@rvagg I can tackle this within the next week or so.
@ded Not lots but including it would help normalize the handler signature between all events: native, custom, triggers.
For custom events, supporting
.typecould suffice.ded commentedon Jan 28, 2014
that's actually a great idea and would work for a first pass. we should probably bump up a minor version after this is implemented
ryanve commentedon Jan 28, 2014
Sounds like a plan.
Add fire-demo.html to inspect handler arguments (fat#80, fat#102)
Normalize handler signature per fat#102 and fat#80