I like it... but I think it is confusing and inconsistent.
We add this for events, but why not for animations ? or ajax
requests ?
Also... you need to document, the 'this' of the handler will be the
currentTarget, UNLESS you passed a scope to bind(). I think features
like this affect the learning curve and confuse novice users.
As I see it, I'd rather add a static method like $.bind.
$(...).bind("type", $.bind(scope,fn));
$.bind should copy the guid ($.event.proxy) so that the returned
function can be unbound using just fn and there's no need to save it
in a var.
My $0.02
Cheers
--
Ariel Flesler
On May 4, 1:47 am, Brandon Aaron <[email protected]> wrote:
> Looking for any feedback on #3699 before committing, which is for allowing
> an alternative scope for events. There is a patch attached to the ticket.
> The ticket actually proposes a method signature that doesn't really fit
> jQuery's style. I added a patch that allows the following call signature
> instead.
> $(...).bind("type", fn, scope);
> $(...).bind("type", data, fn, scope);
>
> This also applies to .one() and .live().
>
> The patch utilizes the internal event.proxy method with a tweak to include
> an optional scope.
>
> --
> Brandon Aaron
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---