mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-15 18:39:52 +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 */
|
/* 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 ) {
|
||||||
|
|
Loading…
Reference in a new issue