Index: trunk/extensions/VisualEditor/modules/es/views/es.SurfaceView.js |
— | — | @@ -351,6 +351,16 @@ |
352 | 352 | this.handleEnter(); |
353 | 353 | e.preventDefault(); |
354 | 354 | break; |
| 355 | + case 90: // z (undo) |
| 356 | + if ( e.ctrlKey ) { |
| 357 | + this.history.undo(); |
| 358 | + break; |
| 359 | + } |
| 360 | + case 89: // y (redo) |
| 361 | + if ( e.ctrlKey ) { |
| 362 | + this.history.redo(); |
| 363 | + break; |
| 364 | + } |
355 | 365 | default: // Insert content (maybe) |
356 | 366 | if ( this.keyboard.keydownTimeout ) { |
357 | 367 | clearTimeout( this.keyboard.keydownTimeout ); |
— | — | @@ -462,7 +472,7 @@ |
463 | 473 | nodeOffset + node.getElementLength(), |
464 | 474 | [ { 'type': 'paragraph' }, { 'type': '/paragraph' } ] |
465 | 475 | ); |
466 | | - this.documentView.model.commit( tx ); |
| 476 | + this.history.commit( tx ); |
467 | 477 | this.selection.from = this.selection.to = nodeOffset + node.getElementLength() + 1; |
468 | 478 | this.showCursor(); |
469 | 479 | } else { |
— | — | @@ -489,7 +499,7 @@ |
490 | 500 | splitable = es.DocumentView.splitRules[ elementType ].self; |
491 | 501 | } ); |
492 | 502 | var tx = this.documentView.model.prepareInsertion( this.selection.to, stack ); |
493 | | - this.documentView.model.commit( tx ); |
| 503 | + this.history.commit( tx ); |
494 | 504 | this.selection.from = this.selection.to = |
495 | 505 | this.documentView.getModel().getRelativeContentOffset( this.selection.to, 1 ); |
496 | 506 | this.showCursor(); |