[Prototype-core] Re: A callbacks module for adding before/after hooks to object methods

2008-05-15 Thread Richard Quadling
2008/5/14 Pat Nakajima [EMAIL PROTECTED]: I've started putting together a way to specify per-object before/after callbacks for any method. Probably not something to go in core, but maybe something that would be interesting to core contributors. There are some examples in a GitHub wiki

[Prototype-core] Re: A callbacks module for adding before/after hooks to object methods

2008-05-15 Thread Pat Nakajima
With regards to your desire to skip the callbacks for some methods, you can actually call methodWithoutCallbacks to call a method sans- callbacks. I think that the wildcard/regex idea is neat, though I'm not sure how it could be accomplished unobtrusively. I could imagine overriding all of the

[Prototype-core] Re: A callbacks module for adding before/after hooks to object methods

2008-05-15 Thread Richard Quadling
2008/5/15 Pat Nakajima [EMAIL PROTECTED]: With regards to your desire to skip the callbacks for some methods, you can actually call methodWithoutCallbacks to call a method sans- callbacks. I think that the wildcard/regex idea is neat, though I'm not sure how it could be accomplished

[Prototype-core] simple 'select' method problem/question

2008-05-15 Thread AJS
I wanted to use the .select method to show an overlay when rolling over a list item: But it doesn't seem to work if I use $(this).select… ? li onmouseover=$(this).select('span').show(); span style=display: none;text/span /li Works fine if I use ids: li onmouseover=$('item1').show(); span

[Prototype-core] Re: simple 'select' method problem/question

2008-05-15 Thread Dan Dorman
On Thu, May 15, 2008 at 9:37 AM, AJS [EMAIL PROTECTED] wrote: But it doesn't seem to work if I use $(this).select… ? That's because select /always/ returns an array. So you can use select, you just have to make sure you access the array element, something like $(this).select('span')[0].show()

[Prototype-core] Re: A callbacks module for adding before/after hooks to object methods

2008-05-15 Thread kangax
I have done something similar in Class.addBehavior: http://github.com/kangax/protolicious/tree/master/class.addbehavior.js On the other hand, it's actually pretty easy to do this with plain Function#wrap: (function(p){ p.push = p.push.wrap(function(){ var args = $A(arguments), proceed =