Index: trunk/extensions/VisualEditor/modules/ve/ce/ve.es.Surface.js |
— | — | @@ -40,24 +40,20 @@ |
41 | 41 | |
42 | 42 | _this.clipboard[key] = ve.copyArray( _this.documentView.model.getData( _this.getSelection() ) ); |
43 | 43 | |
44 | | - console.log(_this.clipboard); |
45 | | - |
46 | | - |
47 | 44 | if (event.type == 'cut') { |
48 | 45 | setTimeout(function() { |
49 | 46 | document.execCommand('undo', false, false); |
50 | 47 | |
51 | 48 | var selection = _this.getSelection(); |
52 | 49 | 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); |
55 | 52 | }, 1); |
56 | 53 | } |
57 | 54 | |
58 | 55 | }) |
59 | 56 | .on('beforepaste paste', function(event) { |
60 | 57 | var insertionPoint = _this.getSelection().start; |
61 | | - console.log(_this.clipboard); |
62 | 58 | |
63 | 59 | $('#paste').html('').show().css('top', $(window).scrollTop()).css('left', $(window).scrollLeft()).focus(); |
64 | 60 | |
— | — | @@ -66,7 +62,7 @@ |
67 | 63 | |
68 | 64 | if (_this.clipboard[key]) { |
69 | 65 | var tx = _this.documentView.model.prepareInsertion( insertionPoint, _this.clipboard[key]); |
70 | | - _this.documentView.model.commit(tx); |
| 66 | + _this.model.transact( tx ); |
71 | 67 | _this.showCursorAt(insertionPoint + _this.clipboard[key].length); |
72 | 68 | } else { |
73 | 69 | alert('i can only handle copy/paste from hybrid surface. sorry. :('); |