• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
AjaxInPlaceEditor ???
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

AjaxInPlaceEditor ???


  • Subject: AjaxInPlaceEditor ???
  • From: Theodore Petrosky <email@hidden>
  • Date: Fri, 24 Jun 2011 08:32:20 -0700 (PDT)

well, at least I am finally able to read some of the source.

I see in the API a binding for the clickToEditText

however in the wonder_inplace.js I see:

if (typeof Ajax != 'undefined' && typeof Ajax.InPlaceEditor != 'undefined') {
  Ajax.InPlaceEditorWithEmptyText = Class.create(Ajax.InPlaceEditor, {

    initialize: function($super, element, url, options) {
      var newOptions = Object.extend({
        valueWhenEmpty: 'click to edit...',
        emptyClassName: 'inplaceeditor-empty'
      }, options || {});
      $super(element, url, newOptions);
      this.checkEmpty();
    },

    checkEmpty: function() {
      if(this.element.innerHTML.length == 0 && this.options.valueWhenEmpty){
        this.element.appendChild(
            new Element("span", {className:this.options.emptyClassName}).update(this.options.valueWhenEmpty)
        );
      }
    },

    getText: function($super) {
      if(empty_span = this.element.select("." + this.options.emptyClassName).first()) {
        empty_span.remove();
      }
      return $super();
    },

    leaveEditMode : function($super, transport) {
      var retval = $super(transport);
      this.checkEmpty();
      return retval;
    }

  });
}

which explains why the clickToEditText does nothing. So, is there a way for a poor plebe like me to change the clickToEditText without resorting to hacking this .js?

Ted


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: AjaxInPlaceEditor
  • Next by Date: [ANN] Safari Extension 0.98
  • Previous by thread: Re: AjaxInPlaceEditor
  • Next by thread: [ANN] Safari Extension 0.98
  • Index(es):
    • Date
    • Thread