Thanks man that makes it editable again... the only downside is now if there was data there it drops you to a input box with undefined in it instead of the original text.
FIXXED....
it was missing the return piece....

figured it out and maybe this will help someone else out.
getText: function() {
this.element.getElementsBySelector('.'+this.options.emptyClassName).invoke('remove');
return this.__getText();
},
Quote:
Originally Posted by GJay
wrap the getElementsByClassName function with $A().
or replace the whole lot with:
Code:
getText: function() {
this.element.getElementsBySelector('.'+this.options.emptyClassName).invoke('remove');
}
The result of the getElsByClass isn't actually an array (it just acts a lot like one...), and so the Prototype extensions (.each and so on) aren't added to it. getElementsBySelector takes a CSS rule, so add a '.' to the front for a classname-restriction and returns an actual array of prototype-extended elements. Rather than removing the element from it's parent explicity, prototype gives you a 'remove()' method on elements, and by using 'invoke' you remove the need for an anonymous function.
|