Ok, I haven't thought this out fully, but how about

               Event.addBehavior({
                    '#foo:click': (function() {
                         someFunc(this)).bind(this)
                   }

--
Jonathan Rosenberg
Founder & Executive Director, Tabby's Place
http://www.tabbysplace.org/

-----Original Message-----
From: prototype-scriptaculous@googlegroups.com
[mailto:prototype-scriptacul...@googlegroups.com] On Behalf Of patrick
Sent: Friday, April 09, 2010 12:44 PM
To: Prototype & script.aculo.us
Subject: [Proto-Scripty] Re: class.create question

Thanks for the reply T.J.,

When using 'this', one other problem comes up for me which I wasn't
sure how to address.  I use lowpro along with prototype for it's
Event.addBehavior stuff...

So, if I do:

var Foo = (function() {

        var Foo = Class.create({
                initialize: function() {

                   Event.addBehavior({
                       '#foo:click': function() {
                           someFunc(this)
                        }

                   });
                }
        })

       return Foo;
})();

in thie '#foo:click' block, this is referring to the #foo element....
I don't quite get how I would also be able to pass in the class 'this'
instance to someFunc other than having a var foo = this; at the top of
the initialize block..

Can you see a way to get around that?

-patrick

-- 
You received this message because you are subscribed to the Google Groups
"Prototype & script.aculo.us" group.
To post to this group, send email to
prototype-scriptacul...@googlegroups.com.
To unsubscribe from this group, send email to
prototype-scriptaculous+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/prototype-scriptaculous?hl=en.


-- 
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptacul...@googlegroups.com.
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.

Reply via email to