Index: trunk/extensions/VisualEditor/modules/es/models/es.HistoryModel.js |
— | — | @@ -138,7 +138,9 @@ |
139 | 139 | if ( previousStateIndex > this.currentStateIndex ) { |
140 | 140 | for ( var i = previousStateIndex; i > this.currentStateIndex; i-- ) { |
141 | 141 | // Apply transaction to the document |
142 | | - this.doc.rollback( this.states[i] ); |
| 142 | + for ( var j = this.states[i].length - 1; j >= 0; j-- ) { |
| 143 | + this.doc.rollback( this.states[i][j] ); |
| 144 | + } |
143 | 145 | // Emit an undo event with the state to be rolled back |
144 | 146 | this.emit( 'undo', this.states[i] ); |
145 | 147 | } |