r112870 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r112869‎ | r112870 | r112871 >
Date:02:07, 2 March 2012
Author:inez
Status:deferred
Tags:
Comment:
Improvements to changes polling mechanism
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
@@ -50,7 +50,7 @@
5151 _this.onPaste( e );
5252 } )
5353 .on( 'mousedown', function( e ) {
54 - // return _this.onMouseDown( e );
 54+ return _this.onMouseDown( e );
5555 } )
5656 .on( 'compositionstart', function( e ) {
5757 console.log('comp start');
@@ -275,7 +275,20 @@
276276 this.poll.prevOffset = localOffset;
277277 };
278278
 279+ve.es.Surface.prototype.onMouseDown = function( e ) {
 280+ if ( this.poll.interval !== null ) {
 281+ this.stopPolling();
 282+ this.pollContent();
 283+ this.startPolling();
 284+ }
 285+};
 286+
279287 ve.es.Surface.prototype.onKeyDown = function( e ) {
 288+ if ( this.poll.interval !== null ) {
 289+ this.stopPolling();
 290+ this.pollContent();
 291+ this.startPolling();
 292+ }
280293 switch ( e.keyCode ) {
281294 // Enter
282295 case 13:
@@ -321,12 +334,10 @@
322335 }
323336 break;
324337 }
325 - /*
326338 var range = this.getSelection();
327339 if ( range.getLength() !== 0 ) {
328340 e.preventDefault();
329341 }
330 - */
331342 };
332343
333344 ve.es.Surface.prototype.getOffset = function( elem, offset, global ) {

Status & tagging log