r92661 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r92660‎ | r92661 | r92662 >
Date:18:52, 20 July 2011
Author:inez
Status:deferred
Tags:
Comment:
Fix deleting selected content with 'delete' key
Modified paths:
  • /trunk/parsers/wikidom/lib/es/es.Surface.js (modified) (history)

Diff [purge]

Index: trunk/parsers/wikidom/lib/es/es.Surface.js
@@ -245,6 +245,7 @@
246246 this.location = this.selection.end;
247247 this.selection = new es.Selection();
248248 this.deleteContent( deleteSelection );
 249+ this.location.offset -= deleteSelection.to.offset - deleteSelection.from.offset;
249250 } else if ( this.location.offset < this.location.block.getLength() - 1 ) {
250251 var deleteSelection = new es.Selection(
251252 new es.Location( this.location.block, this.location.offset + 1 ), this.location
@@ -267,7 +268,7 @@
268269 surface.mouse.clicks = 0;
269270 }, this.mouse.clickDelay );
270271 } else {
271 - // New location, start over
 272+ // New lonew es.Locationt over
272273 this.mouse.clicks = 1;
273274 this.mouse.clickX = e.pageX;
274275 this.mouse.clickY = e.pageY;
@@ -288,8 +289,8 @@
289290 // Select word offset is within
290291 var boundaries = this.location.block.getWordBoundaries( this.location.offset );
291292 this.selection = new es.Selection(
292 - new Location( this.location.block, boundaries.start ),
293 - new Location( this.location.block, boundaries.end )
 293+ new es.Location( this.location.block, boundaries.start ),
 294+ new es.Location( this.location.block, boundaries.end )
294295 );
295296 this.drawSelection();
296297 break;
@@ -297,8 +298,8 @@
298299 // Select section within block offset is within
299300 var boundaries = this.location.block.getSectionBoundaries( this.location.offset );
300301 this.selection = new es.Selection(
301 - new Location( this.location.block, boundaries.start ),
302 - new Location( this.location.block, boundaries.end )
 302+ new es.Location( this.location.block, boundaries.start ),
 303+ new es.Location( this.location.block, boundaries.end )
303304 );
304305 this.drawSelection();
305306 break;

Status & tagging log