r103610 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r103609‎ | r103610 | r103611 >
Date:20:09, 18 November 2011
Author:inez
Status:deferred
Tags:
Comment:
Reset value of initialBias and initialLeft states after pressing backspace/delete/enter or typing text
Modified paths:
  • /trunk/extensions/VisualEditor/modules/es/views/es.SurfaceView.js (modified) (history)

Diff [purge]

Index: trunk/extensions/VisualEditor/modules/es/views/es.SurfaceView.js
@@ -323,6 +323,7 @@
324324 }
325325 break;
326326 case 8: // Backspace
 327+ this.cursor.initialBias = this.cursor.initialLeft = null;
327328 if ( this.selection.from === this.selection.to ) {
328329 var sourceOffset = this.selection.to,
329330 targetOffset = this.documentView.getModel().getRelativeContentOffset( sourceOffset, -1),
@@ -369,6 +370,7 @@
370371 }
371372 break;
372373 case 46: // Delete
 374+ this.cursor.initialBias = this.cursor.initialLeft = null;
373375 if ( this.selection.from === this.selection.to ) {
374376 var sourceOffset = this.documentView.getModel().getRelativeContentOffset( this.selection.to, 1),
375377 targetOffset = this.selection.to,
@@ -413,6 +415,7 @@
414416 }
415417 break;
416418 case 13: // Enter
 419+ this.cursor.initialBias = this.cursor.initialLeft = null;
417420 if ( this.selection.from === this.selection.to ) {
418421 var node = this.documentView.getNodeFromOffset( this.selection.to, false ),
419422 nodeOffset = this.documentView.getOffsetFromNode( node, false );
@@ -451,6 +454,7 @@
452455 e.preventDefault();
453456 break;
454457 default: // Insert content (maybe)
 458+ this.cursor.initialBias = this.cursor.initialLeft = null;
455459 if ( this.keyboard.keydownTimeout ) {
456460 clearTimeout( this.keyboard.keydownTimeout );
457461 }

Status & tagging log