r111020 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r111019‎ | r111020 | r111021 >
Date:07:39, 9 February 2012
Author:christian
Status:deferred
Tags:
Comment:
using transact
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
@@ -40,24 +40,20 @@
4141
4242 _this.clipboard[key] = ve.copyArray( _this.documentView.model.getData( _this.getSelection() ) );
4343
44 - console.log(_this.clipboard);
45 -
46 -
4744 if (event.type == 'cut') {
4845 setTimeout(function() {
4946 document.execCommand('undo', false, false);
5047
5148 var selection = _this.getSelection();
5249 var tx = _this.model.getDocument().prepareRemoval( selection );
53 - //_this.model.transact( tx );
54 - //_this.showCursorAt(selection.start);
 50+ _this.model.transact( tx );
 51+ _this.showCursorAt(selection.start);
5552 }, 1);
5653 }
5754
5855 })
5956 .on('beforepaste paste', function(event) {
6057 var insertionPoint = _this.getSelection().start;
61 - console.log(_this.clipboard);
6258
6359 $('#paste').html('').show().css('top', $(window).scrollTop()).css('left', $(window).scrollLeft()).focus();
6460
@@ -66,7 +62,7 @@
6763
6864 if (_this.clipboard[key]) {
6965 var tx = _this.documentView.model.prepareInsertion( insertionPoint, _this.clipboard[key]);
70 - _this.documentView.model.commit(tx);
 66+ _this.model.transact( tx );
7167 _this.showCursorAt(insertionPoint + _this.clipboard[key].length);
7268 } else {
7369 alert('i can only handle copy/paste from hybrid surface. sorry. :(');

Status & tagging log