mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-15 02:23:58 +00:00
States is an array of array of transaction, so one more iteration is needed.
This commit is contained in:
parent
70837a026a
commit
392d911c3d
|
@ -138,7 +138,9 @@ es.HistoryModel.prototype.undo = function( steps ) {
|
|||
if ( previousStateIndex > this.currentStateIndex ) {
|
||||
for ( var i = previousStateIndex; i > this.currentStateIndex; i-- ) {
|
||||
// Apply transaction to the document
|
||||
this.doc.rollback( this.states[i] );
|
||||
for ( var j = this.states[i].length - 1; j >= 0; j-- ) {
|
||||
this.doc.rollback( this.states[i][j] );
|
||||
}
|
||||
// Emit an undo event with the state to be rolled back
|
||||
this.emit( 'undo', this.states[i] );
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue