mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-09-27 12:16:51 +00:00
Implement newFromInsertion()
Mostly just wraps around fixupInsertion() Change-Id: I5c9128439b9ed29b112590c0004a749f9b529346
This commit is contained in:
parent
3be3f55c91
commit
cce32103ff
|
@ -12,7 +12,11 @@ ve.dm.Transaction = function() {
|
|||
/* Static Methods */
|
||||
|
||||
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 ) {
|
||||
|
|
Loading…
Reference in a new issue