Index: trunk/parsers/wikidom/lib/es/es.Surface.js |
— | — | @@ -245,6 +245,7 @@ |
246 | 246 | this.location = this.selection.end; |
247 | 247 | this.selection = new es.Selection(); |
248 | 248 | this.deleteContent( deleteSelection ); |
| 249 | + this.location.offset -= deleteSelection.to.offset - deleteSelection.from.offset; |
249 | 250 | } else if ( this.location.offset < this.location.block.getLength() - 1 ) { |
250 | 251 | var deleteSelection = new es.Selection( |
251 | 252 | new es.Location( this.location.block, this.location.offset + 1 ), this.location |
— | — | @@ -267,7 +268,7 @@ |
268 | 269 | surface.mouse.clicks = 0; |
269 | 270 | }, this.mouse.clickDelay ); |
270 | 271 | } else { |
271 | | - // New location, start over |
| 272 | + // New lonew es.Locationt over |
272 | 273 | this.mouse.clicks = 1; |
273 | 274 | this.mouse.clickX = e.pageX; |
274 | 275 | this.mouse.clickY = e.pageY; |
— | — | @@ -288,8 +289,8 @@ |
289 | 290 | // Select word offset is within |
290 | 291 | var boundaries = this.location.block.getWordBoundaries( this.location.offset ); |
291 | 292 | 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 ) |
294 | 295 | ); |
295 | 296 | this.drawSelection(); |
296 | 297 | break; |
— | — | @@ -297,8 +298,8 @@ |
298 | 299 | // Select section within block offset is within |
299 | 300 | var boundaries = this.location.block.getSectionBoundaries( this.location.offset ); |
300 | 301 | 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 ) |
303 | 304 | ); |
304 | 305 | this.drawSelection(); |
305 | 306 | break; |