Merge "Document the fact that ve.dm.MetaItem#replaceWith takes a plain object"

This commit is contained in:
jenkins-bot 2013-11-18 08:42:21 +00:00 committed by Gerrit Code Review
commit 8fc7c8d336
2 changed files with 5 additions and 1 deletions

View file

@ -62,7 +62,9 @@ ve.dm.MetaItem.prototype.remove = function () {
/**
* Replace item with another in-place.
*
* @param {ve.dm.MetaItem} item Item to replace this item with
* Pass a plain object rather than a MetaItem into this function unless you know what you're doing.
*
* @param {Object|ve.dm.MetaItem} item Item to replace this item with
*/
ve.dm.MetaItem.prototype.replaceWith = function ( item ) {
var offset = this.getOffset(),

View file

@ -334,6 +334,8 @@ ve.dm.MetaList.prototype.getAllItems = function () {
/**
* Insert new metadata into the document. This builds and processes a transaction that inserts
* metadata into the document.
*
* Pass a plain object rather than a MetaItem into this function unless you know what you're doing.
* @param {Object|ve.dm.MetaItem} meta Metadata element (or MetaItem) to insert
* @param {Number} [offset] Offset to insert the new metadata, or undefined to add to the end
* @param {Number} [index] Index to insert the new metadata, or undefined to add to the end