Hi Patrick,

You could do somethink like that:

BuilderBox.buttons = {

    add_behavior: {
      '.some_class:click': function(element) {
        this.containerMorph(element);
      }
    },

   containerMorph: function(element) {

...
but in that case, you can't bind the function to the element. But is
there a specific reason to create an object with methods and bind each
method with something else than the object itself ??

Normally, an object create with method always refers to itself and you
just give parameter to the called method.

Perhaps, if you have a specific need, it need a specific notation.
Explain a little bit more why you want another notation?

--
david

On 28 oct, 03:00, patrick <patrick99...@gmail.com> wrote:
>   BuilderBox.buttons = {
>
>     add_behavior: {
>       '.some_class:click': function() {
>         BuilderBox.buttons.containerMorph(this);
>       }
>     },
>
>    containerMorph: function(element) {
>
> ...
>
> I am wondering, is there is a way to not have to reference
> BuilderBox.buttons inside the function above?  Since it's happening
> inside BuilderBox.buttons, I would like to reference it as "this"...
> but if I do .bind(this) to that function, then the "this" which
> references the element being clicked will be lost...  Is there another
> way to do this?
>
> ?
>
> -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-scriptaculous@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