[jquery-dev] Re: Optional scope for events

2009-05-07 Thread aHeckman
I vote for subject or context On May 6, 4:41 pm, alberto tarin...@gmail.com wrote: On May 4, 6:47 am, Brandon Aaron brandon.aa...@gmail.com 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

[jquery-dev] Re: Optional scope for events

2009-05-07 Thread Balazs Endresz
I've just had a look at r6344 and there seems to be an extra argument in jQuery.event.add but that function hasn't been modified (yet?). And maybe it's been mentioned before but if you're really adding this feature why not do the same with $.each? Hopefully no one uses the internal `args`

[jquery-dev] Re: Optional scope for events

2009-05-07 Thread chris thatcher
context++ On Thu, May 7, 2009 at 1:53 PM, Balazs Endresz balazs.endr...@gmail.comwrote: I've just had a look at r6344 and there seems to be an extra argument in jQuery.event.add but that function hasn't been modified (yet?). And maybe it's been mentioned before but if you're really adding

[jquery-dev] Re: Optional scope for events

2009-05-06 Thread ajpiano
This is definitely useful and necessary. I'd put my two cents for it being called either scope or context, which, though taken, describe the actual purpose of the additional argument. pointer might also be an appropriate name. --adam On May 5, 1:22 pm, Nathan Bubna nbu...@gmail.com wrote:

[jquery-dev] Re: Optional scope for events

2009-05-06 Thread Ariel Flesler
Assuming we do leave it within $.fn.bind(), then I'd say scope or context. Completely against the other ones mentioned so far :) On Wed, May 6, 2009 at 5:02 PM, ajpiano ajpi...@gmail.com wrote: This is definitely useful and necessary.  I'd put my two cents for it being called either scope or

[jquery-dev] Re: Optional scope for events

2009-05-06 Thread Ricardo
I like that, it's perfectly accurate. Having overloaded methods is already confusing, calling this feature scoping when it has nothing to do with scope is a step in the wrong direction. Naming and docs should be based on technically accurate and clearly understandable concepts. On May 5, 10:44 

[jquery-dev] Re: Optional scope for events

2009-05-06 Thread Nathan Bubna
Well, to unify against scope and context, i'll throw my $.02 behind thisObject. It's closer to Mozilla's thisArg (which would also be fine). https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Function/apply

[jquery-dev] Re: Optional scope for events

2009-05-06 Thread alberto
On May 4, 6:47 am, Brandon Aaron brandon.aa...@gmail.com 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-dev] Re: Optional scope for events

2009-05-05 Thread Brandon Aaron
How about thisObject? Taken from Mozilla's docs for the forEach method ( https://developer.mozilla.org/En/Core_JavaScript_1.5_Reference:Objects:Array:forEach). -- Brandon Aaron On Mon, May 4, 2009 at 11:38 PM, Michael Geary m...@mg.to wrote: I don't find this feature all that useful myself,

[jquery-dev] Re: Optional scope for events

2009-05-05 Thread Nathan Bubna
Why not steal the term from grammar and call it the subject? On May 4, 9:38 pm, Michael Geary m...@mg.to wrote: I don't find this feature all that useful myself, since my callback functions tend to be a mix of jQuery/DOM, setTimeout, Google Maps/Earth, and other asynchronous APIs. If I can

[jquery-dev] Re: Optional scope for events

2009-05-04 Thread Paul Bakaus
I love that functionality, looks good to me! Paul Bakaus UI Architect http://paulbakaus.com Am 04.05.2009 um 06:47 schrieb Brandon Aaron brandon.aa...@gmail.com: Looking for any feedback on #3699 before committing, which is for allowing an alternative scope for events. There is a patch

[jquery-dev] Re: Optional scope for events

2009-05-04 Thread Ariel Flesler
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

[jquery-dev] Re: Optional scope for events

2009-05-04 Thread Brandon Aaron
Yes, you can still unbind the named handler. The jQuery.event.proxy method takes care of this. -- Brandon Aaron 2009/5/4 Scott González scott.gonza...@gmail.com Would you be able to unbind a specific function with a specific scope? $(el).bind('click', fn, foo); $(el).bind('click', fn,

[jquery-dev] Re: Optional scope for events

2009-05-04 Thread pete higgins
I agree with Ariel, that this would be better served as a static method. Dojo does the (fn, scope) (actually, we do a mixmatch and allow curried args, but I digress) and it definitely is a learning curve for js n00bs, and certainly not very jQuery-ish. by making it a separate method, it becomes

[jquery-dev] Re: Optional scope for events

2009-05-04 Thread Brandon Aaron
I don't agree that this is confusing. I find it to be very beneficial to have a method signature that grows to meet your needs but doesn't get in your way when you don't need all of it. I know we've received both insult and praise for our overloaded methods but that is how we roll! :) It might be

[jquery-dev] Re: Optional scope for events

2009-05-04 Thread Nate Cavanaugh
I actually have to disagree with Pete and Ariel on this. There are plenty of concepts that throw off the uninitiated, such as any scoping, or even the funky concept of defining a function in the method signature of another method. And since the parameter is the last in the signature, it's

[jquery-dev] Re: Optional scope for events

2009-05-04 Thread Brandon Aaron
I still do not agree that this is better achieved by a static bind/hitch method alone (for jQuery). Just because it is a typical power user feature doesn't mean we shouldn't make it easily useable by non-power users. But for me it is more than just catering to various levels of knowledge... it is