Garito a écrit :
> For that I have some questions to ask. As they are minor questions (at
> least it seems to me) I make them here in only one threat (sorry if
> you think will be better in a separated threats)

I love your typo ("threat" instead of "thread"); it feels like we're in 
the comments on some Vi-vs-Emacs flamewar.

> Perhaps they will be for Christophe again (sorry for make you work
> again ;) )

Hey, if I minded, I wouldn't read it.  Plus, I need to stretch my legs 
on this list again and maintain my reply score ;-)

> This is my question: have you any problem if Christophe change this
> line to something like:
> 
> $H(this.Listeners).each(function(pair) {
> 
> ?
> With this change you could subclass Ajax.InPlaceEditor to register
> other events instead of the original ones

Except this won't work.  You're mistaking instance fields and class 
fields.  A.IPE.Listeners is a class-level member.  However, you could 
look into how A.IPCE augments default options for a way to do such a 
thing (which admittedly is a bit tortuous).

I could imagine a _extraListeners field in there somewhere, but to make 
all this really cleaner I'd need to use Prototype's inheritance mechanism.

In the meantime you can just override registerListeners and 
unregisterListeners in your subclass and start by calling the inherited 
version, something like:

Ajax.MyInPlaceEditor = Class.create(Ajax.InPlaceEditor, {
   // ...
   registerListeners: function($super) {
     $super();
     // your registrations here
   },
   unregisterListeners: function($super) {
     // your "unregistrations" here
     $super();
   }
});

> Or, if you prefer, how can I change the default Listeners?

Just overwrite Ajax.InPlaceEditor.Listeners, but that would be dangerous 
(in the sense that it could break behavior elsewhere on your page).

What you could do is tweak A.IPE directly by adding new methods in it 
and then adding the matching defs in A.IPE.Listeners.

That could work, but will affect *all* IPE's in your page, when you 
might want to create a subclass for specific needs that do not pertain 
to all IPEs on your page.

> I notice that if I try to cancel an edition with the escape key it
> doesn't work (nothing happens) and if I cancel with the link button
> the url location changes to the parent location plus #

That's just plain wrong.  None of these behaviors should occur, and they 
sure DON'T occur on my implementation.  I suggest you check that you 
have the latest version and run the unit test page for IPE to verify 
everything passes.  If it doesn't, I and Thomas are interested in 
learning more about it.

-- 
Christophe Porteneuve aka TDD
[EMAIL PROTECTED]

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" 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/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to