r110947 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r110946‎ | r110947 | r110948 >
Date:18:06, 8 February 2012
Author:christian
Status:deferred
Tags:
Comment:
using execcommand to undo cut - model controls mutation
Modified paths:
  • /trunk/extensions/VisualEditor/modules/ve/ce/ve.es.Surface.js (modified) (history)

Diff [purge]

Index: trunk/extensions/VisualEditor/modules/ve/ce/ve.es.Surface.js
@@ -38,10 +38,12 @@
3939
4040 console.log(_this.clipboard);
4141
 42+
4243 if (event.type == 'cut') {
43 - var selection = _this.getSelection();
44 -
4544 setTimeout(function() {
 45+ document.execCommand('undo', false, false);
 46+
 47+ var selection = _this.getSelection();
4648 var tx = _this.model.getDocument().prepareRemoval( selection );
4749 _this.model.transact( tx );
4850 _this.showCursorAt(selection.start);

Status & tagging log