r113306 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r113305‎ | r113306 | r113307 >
Date:21:41, 7 March 2012
Author:christian
Status:deferred
Tags:
Comment:
removing usage of rangy anchornode for determining rendering scope - using model and autoRender
Modified paths:
  • /trunk/extensions/VisualEditor/modules/ve/ce/ve.ce.Surface.js (modified) (history)

Diff [purge]

Index: trunk/extensions/VisualEditor/modules/ve/ce/ve.ce.Surface.js
@@ -171,15 +171,14 @@
172172 // we don't like how browsers cut, so let's undo it and do it ourselves.
173173 document.execCommand('undo', false, false);
174174
175 - var selection = _this.getSelectionRange(),
176 - node = rangy.getSelection().anchorNode;
 175+ var selection = _this.getSelectionRange();
177176
178177 // transact
179178 var tx = _this.model.getDocument().prepareRemoval( selection );
 179+
 180+ _this.autoRender = true;
180181 _this.model.transact( tx );
181 -
182 - // re-render
183 - _this.getLeafNode( node ).data( 'view' ).renderContent();
 182+ _this.autoRender = false;
184183
185184 _this.clearPollData();
186185
@@ -191,8 +190,7 @@
192191
193192 ve.ce.Surface.prototype.onPaste = function( e ) {
194193 var _this = this,
195 - insertionPoint = _this.getSelectionRange().start,
196 - node = rangy.getSelection().anchorNode;
 194+ insertionPoint = _this.getSelectionRange().start;
197195
198196 $('#paste')
199197 .html('')

Status & tagging log