Index: trunk/parsers/wikidom/lib/es/es.Surface.js |
— | — | @@ -232,8 +232,9 @@ |
233 | 233 | var deleteSelection = new es.Selection( |
234 | 234 | new es.Location( this.location.block, this.location.offset - 1 ), this.location |
235 | 235 | ); |
| 236 | + deleteSelection.normalize(); |
236 | 237 | this.selection = new es.Selection(); |
237 | | - this.location = deleteSelection.from; |
| 238 | + this.location = deleteSelection.start; |
238 | 239 | this.deleteContent( deleteSelection ); |
239 | 240 | } |
240 | 241 | }; |
— | — | @@ -242,18 +243,17 @@ |
243 | 244 | if ( this.selection.from && this.selection.to ) { |
244 | 245 | var deleteSelection = this.selection; |
245 | 246 | deleteSelection.normalize(); |
246 | | - this.location = this.selection.end; |
| 247 | + this.location = this.selection.start; |
247 | 248 | this.selection = new es.Selection(); |
248 | 249 | this.deleteContent( deleteSelection ); |
249 | | - this.location.offset -= deleteSelection.to.offset - deleteSelection.from.offset; |
250 | 250 | } else if ( this.location.offset < this.location.block.getLength() - 1 ) { |
251 | 251 | var deleteSelection = new es.Selection( |
252 | 252 | new es.Location( this.location.block, this.location.offset + 1 ), this.location |
253 | 253 | ); |
| 254 | + deleteSelection.normalize(); |
254 | 255 | this.selection = new es.Selection(); |
255 | | - this.location = deleteSelection.from; |
| 256 | + this.location = deleteSelection.start; |
256 | 257 | this.deleteContent( deleteSelection ); |
257 | | - this.location.offset--; |
258 | 258 | } |
259 | 259 | }; |
260 | 260 | |