Have you looked into extending the existing behavior of the
InPlaceEditor? If you want to perform some extra actions when going
into edit mode, you can wrap the enterEditMode method (or another one,
if it is more fitting) such that you can either do something before or
after enterEditMode is called. Nicolas helped with this very thing
just last week when I asked a similar question to yours.

Take for example the following code, which would reside in your
applicaiton.js file or somewhere else more fitting:

Ajax.InPlaceEditor.prototype.enterEditMode =
Ajax.InPlaceEditor.prototype.enterEditMode.wrap( function(){
  var args = $A(arguments), proceed = args.shift();

  // Your custom code before #enterEditMode is called goes here
  proceed();
  // Your custom code after #enterEditMode is called goes here
});

Take a look at controls.js in Scriptaculous if you'd like to override
a different method or access any attributes (element IDs, form
objects, etc..).

-justin

--~--~---------~--~----~------------~-------~--~----~
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