Hi Guys,

Great job on Prototype 1.5.1rc3 8) !
When I updated I noticed a lot of my onmouseover events were acting

my handlers looked like Tooltip.show(event, forceShow)....

I expected the Event object as the first param and then the second to
be a flag that would bypass the delay and show the tooltip instantly.

Well. It turns out now that the event object is the first and second
param because:

Function.prototype.bindAsEventListener = function(object) {
  var __method = this, args = $A(arguments), object = args.shift();
  return function(event) {
    return __method.apply(object, [( event ||

is appending it to the front of the args array, when it already

The docs mention something about fixing an MSIE issue but I am using
MSIE and the event object is being passed in as the first. This
creates a case of the first two params being Event objects.

A check if the event object is the first param before adding it is

Or maybe a method similar to:

Here is my attempt to fix it, this works for IE and Firefox, not sure
about the rest.

Function.prototype.bindAsEventListener = function(object) {
  var __method = this, bindArgs = $A(arguments), object =

  return function(event) {

    var methodArgs, funcArgs = $A(arguments);
    var hasEvent = (typeof funcArgs[0] == 'object' && (/[a-zA-Z]Event
\]/.test(funcArgs[0]) || typeof funcArgs[0].srcElement !=

      methodArgs = bindArgs.concat(funcArgs);
      methodArgs = [( event ||

    return __method.apply(object, methodArgs);

You received this message because you are subscribed to the Google Groups 
"Prototype: Core" group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 

Reply via email to