Yeah, it looks like the enterEditMode method needs to add two things:

 

1) have an argument so that the event can be passed into the method (this is what bindAsEventListener lets you do)

  enterEditMode: function(evt) {

 

2) probably as the last thing in the method, it should do this:

  Event.stop(evt);

  return false;

though I’m not sure you even need the return false if you’ve already stopped the event

 

The new method then turns into this I think:

 

  enterEditMode: function(evt) {

    if (this.saving) return;

    if (this.editing) return;

    this.editing = true;

    this.onEnterEditMode();

    if (this.options.externalControl) {

      Element.hide(this.options.externalControl);

    }

    Element.hide(this.element);

    this.form = this.getForm();

    this.element.parentNode.insertBefore(this.form, this.element);

    Event.stop(evt);

    return false;

  },

 

Rahul

 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jay Levitt
Sent: Tuesday, October 25, 2005 11:36 AM
To: rails-spinoffs@lists.rubyonrails.org
Subject: Re: [Rails-spinoffs] InPlaceEditor scrolls to top in Firefox?

 

Jon Tirsen wrote:

I think that usually means that the href points to "#" and one of two things:
 
1) the onclick event handler is not returning false to cancel out the
actual link action
2) the onclick event handler is erroring out
 
I haven't looked at the IPE much, however.
    

 
The thing is, it's not a anchor, it's just an onclick handler. But you
might be right, I should probably stop the event and return false.
  

That makes sense... I don't know JS so well, so I can't code it myself, but if you have a patch (or even a cut & paste) I'm happy to try it here!  My app is for a small enough number of users/records that I'm not paginating, and they're all on laptops.  Result: Edit-in-place has become edit-in-some-other-place :)

Jay

_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
  

 

_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs

Reply via email to