Closed AmicaNoctis closed 11 years ago
Amica, this feature implementation cannot be merged. Although the implemented getTextContent/setTextContent may sound practical, there is already Query.text function that does the same. var old_text = ample.query("#element").text(); ample.query("#element").text("new_text");
Includes previous pull request: https://github.com/clientside/amplesdk/pull/179
Summary
There is a textContent property, but it is useless. It always returns null and cannot react on modifications. In some cases it would be helpful to access it however, even if this access has to be performed via getter/setter methods. So it should be disabled by default, but possible to enable it easily at runtime, e. g. per ample.config()
A possible solution to this is enclosed in this pull request.
Changes
Improved fNode_getTextContent, added fNode_setTextContent. Added configuration option to expose these methods in the Node class (default: don't expose).
Example session