Index: trunk/extensions/VisualEditor/modules/ve/ce/ve.es.Surface.js |
— | — | @@ -298,15 +298,15 @@ |
299 | 299 | }; |
300 | 300 | |
301 | 301 | ve.es.Surface.prototype.getSelection = function() { |
302 | | - var selection = rangy.getSelection(); |
| 302 | + var rangySel = rangy.getSelection(); |
303 | 303 | |
304 | | - if ( selection.anchorNode === selection.focusNode && selection.anchorOffset === selection.focusOffset ) { |
305 | | - var offset = this.getOffset( selection.anchorNode, selection.anchorOffset ); |
| 304 | + if ( rangySel.anchorNode === rangySel.focusNode && rangySel.anchorOffset === rangySel.focusOffset ) { |
| 305 | + var offset = this.getOffset( rangySel.anchorNode, rangySel.anchorOffset, true ); |
306 | 306 | return new ve.Range( offset, offset ); |
307 | 307 | } else { |
308 | 308 | return new ve.Range( |
309 | | - this.getOffset( selection.anchorNode, selection.anchorOffset ), |
310 | | - this.getOffset( selection.focusNode, selection.focusOffset ) |
| 309 | + this.getOffset( rangySel.anchorNode, rangySel.anchorOffset, true ), |
| 310 | + this.getOffset( rangySel.focusNode, rangySel.focusOffset, true ) |
311 | 311 | ); |
312 | 312 | } |
313 | 313 | }; |