Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Commit

Permalink
Improved insertContent() docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
Reinmar committed Oct 26, 2018
1 parent 7db5fee commit a16ad47
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/model/model.js
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,9 @@ export default class Model {
*
* // Insert text at given position - document selection will not be modified.
* editor.model.change( writer => {
* editor.model.insertContent( writer.createText( 'x' ), doc.getRoot(), 2 );
*
* // Which is a shorthand for:
* editor.model.insertContent( writer.createText( 'x' ), Position.createAt( doc.getRoot(), 2 ) );
* } );
*
Expand All @@ -327,10 +330,11 @@ export default class Model {
* @fires insertContent
* @param {module:engine/model/documentfragment~DocumentFragment|module:engine/model/item~Item} content The content to insert.
* @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection|
* module:engine/model/position~Position|module:engine/model/element~Element|
* module:engine/model/position~Position|module:engine/model/item~Item|
* Iterable.<module:engine/model/range~Range>|module:engine/model/range~Range|null} [selectable=model.document.selection]
* Selection into which the content should be inserted. If not provided the current model document selection will be used.
* @param {Number|'before'|'end'|'after'|'on'|'in'} [placeOrOffset] Sets place or offset of the selection.
* @param {Number|'before'|'end'|'after'|'on'|'in'} [placeOrOffset] To be used when a model item was passed as `selectable`.
* This param defines a position in relation to that item.
*/
insertContent( content, selectable, placeOrOffset ) {
insertContent( this, content, selectable, placeOrOffset );
Expand Down

0 comments on commit a16ad47

Please sign in to comment.