Index: trunk/extensions/VisualEditor/modules/ve/ce/ve.ce.Surface.js |
— | — | @@ -118,8 +118,8 @@ |
119 | 119 | }; |
120 | 120 | |
121 | 121 | ve.ce.Surface.prototype.getAnnotations = function() { |
122 | | - return this.getSelection().getLength() ? |
123 | | - this.model.getDocument().getAnnotationsFromRange( this.getSelection() ) : |
| 122 | + return this.getSelectionRange().getLength() ? |
| 123 | + this.model.getDocument().getAnnotationsFromRange( this.getSelectionRange() ) : |
124 | 124 | { |
125 | 125 | 'full': this.insertionAnnotations, |
126 | 126 | 'partial': [], |
— | — | @@ -137,7 +137,7 @@ |
138 | 138 | |
139 | 139 | ve.ce.Surface.prototype.loadInsertionAnnotations = function( annotation ) { |
140 | 140 | this.insertionAnnotations = |
141 | | - this.model.getDocument().getAnnotationsFromOffset( this.getSelection().to - 1 ); |
| 141 | + this.model.getDocument().getAnnotationsFromOffset( this.getSelectionRange().to - 1 ); |
142 | 142 | // Filter out annotations that aren't textStyles or links |
143 | 143 | for ( var i = 0; i < this.insertionAnnotations.length; i++ ) { |
144 | 144 | if ( !this.insertionAnnotations[i].type.match( /(textStyle\/|link\/)/ ) ) { |
— | — | @@ -280,7 +280,7 @@ |
281 | 281 | |
282 | 282 | ve.ce.Surface.prototype.pollContent = function() { |
283 | 283 | var localOffset, text, hash; |
284 | | - |
| 284 | + |
285 | 285 | if ( this.poll.compositionStart !== null && this.poll.compositionEnd !== null ) { |
286 | 286 | |
287 | 287 | text = ve.ce.Surface.getDOMText2( this.poll.node ); |
— | — | @@ -448,7 +448,7 @@ |
449 | 449 | break; |
450 | 450 | } |
451 | 451 | var range = this.getSelectionRange(); |
452 | | - if ( range.getLength() !== 0 ) { |
| 452 | + if ( range.getLength() !== 0 && this.poll.compositionStart === null) { |
453 | 453 | e.preventDefault(); |
454 | 454 | } |
455 | 455 | }; |