editor.val(val)

editor.val(val)

RagnarGrootKoerkampRagnarGrootKoerkamp Posts: 48Questions: 14Answers: 1

When doing (for the sake of example) editor.val(editor.val()), the outer val function will call editor.get() instead of editor.set, because (looking at Editor.prototype.val), the second parameter is undefined.

This can easily be solved by using editor.set(editor.get()) or editor.val(editor.val(), true) for example, but the current examples on the val() don't work.

Replies

  • allanallan Posts: 61,731Questions: 1Answers: 10,110 Site admin

    Thanks for pointing that out - that is a bug in Editor rather the documentation! I'll have it fixed for the next version.

    Allan

  • allanallan Posts: 61,731Questions: 1Answers: 10,110 Site admin

    Quick update on this as I've just been reviewing it. I think the examples in the documentation (although they don't currently work) are actually a good implementation and that this is in fact a bug in the code rather than the docs.

    As such I've just committed a change that will be included in 1.6 such that when an object is passed in to the first parameter, it will be used as a setter rather than a getter, which matches the documentation.

    1.6.0 should drop next week.

    Allan

This discussion has been closed.