r103395 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r103394‎ | r103395 | r103396 >
Date:22:01, 16 November 2011
Author:inez
Status:deferred
Tags:
Comment:
Added basic support for deleting selection with delete key.
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
@@ -345,6 +345,16 @@
346346
347347 break;
348348 case 46: // Delete
 349+ this.selection.normalize();
 350+
 351+ if ( this.selection.from != this.selection.to ) { // delete selection
 352+ var tx = this.documentView.model.prepareRemoval( this.selection );
 353+ this.documentView.model.commit ( tx );
 354+ this.documentView.clearSelection();
 355+ this.selection.from = this.selection.to = this.selection.start;
 356+ this.showCursor();
 357+ }
 358+
349359 break;
350360 default: // Insert content (maybe)
351361 if ( this.keyboard.keydownTimeout ) {

Status & tagging log