mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-09-25 11:16:51 +00:00
using execcommand to undo cut - model controls mutation
This commit is contained in:
parent
3f7c1499cd
commit
e3e3150399
Notes:
Gabriel Wicke
2012-02-27 16:40:01 +00:00
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue