using execcommand to undo cut - model controls mutation

This commit is contained in:
christian 2012-02-08 18:06:03 +00:00
parent 3f7c1499cd
commit e3e3150399
Notes: Gabriel Wicke 2012-02-27 16:40:01 +00:00

View file

@ -38,10 +38,12 @@ ve.es.Surface = function( $container, model ) {
console.log(_this.clipboard);
if (event.type == 'cut') {
var selection = _this.getSelection();
if (event.type == 'cut') {
setTimeout(function() {
document.execCommand('undo', false, false);
var selection = _this.getSelection();
var tx = _this.model.getDocument().prepareRemoval( selection );
_this.model.transact( tx );
_this.showCursorAt(selection.start);