Implement newFromInsertion()

Mostly just wraps around fixupInsertion()

Change-Id: I5c9128439b9ed29b112590c0004a749f9b529346
This commit is contained in:
Catrope 2012-05-22 13:17:27 -07:00
parent 3be3f55c91
commit cce32103ff

View file

@ -12,7 +12,11 @@ ve.dm.Transaction = function() {
/* Static Methods */ /* Static Methods */
ve.dm.Transaction.newFromInsertion = function( doc, offset, data ) { ve.dm.Transaction.newFromInsertion = function( doc, offset, data ) {
// Implement me! var toInsert = doc.fixupInsertion( data, offset );
var tx = new ve.dm.Transaction();
tx.pushRetain( offset );
tx.pushReplace( [], toInsert );
return tx;
}; };
ve.dm.Transaction.newFromRemoval = function( doc, range ) { ve.dm.Transaction.newFromRemoval = function( doc, range ) {