From e3e3150399cec85b2df5a4e121fd617855fd9598 Mon Sep 17 00:00:00 2001 From: christian Date: Wed, 8 Feb 2012 18:06:03 +0000 Subject: [PATCH] using execcommand to undo cut - model controls mutation --- modules/ve/ce/ve.es.Surface.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/ve/ce/ve.es.Surface.js b/modules/ve/ce/ve.es.Surface.js index a326a4b183..1bae506417 100644 --- a/modules/ve/ce/ve.es.Surface.js +++ b/modules/ve/ce/ve.es.Surface.js @@ -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);