r113660 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r113659‎ | r113660 | r113661 >
Date:20:39, 12 March 2012
Author:christian
Status:deferred
Tags:
Comment:
switch to getSelectionRange and fixing IME native menu
Modified paths:
  • /trunk/extensions/VisualEditor/modules/ve/ce/ve.ce.Surface.js (modified) (history)

Diff [purge]

Index: trunk/extensions/VisualEditor/modules/ve/ce/ve.ce.Surface.js
@@ -118,8 +118,8 @@
119119 };
120120
121121 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() ) :
124124 {
125125 'full': this.insertionAnnotations,
126126 'partial': [],
@@ -137,7 +137,7 @@
138138
139139 ve.ce.Surface.prototype.loadInsertionAnnotations = function( annotation ) {
140140 this.insertionAnnotations =
141 - this.model.getDocument().getAnnotationsFromOffset( this.getSelection().to - 1 );
 141+ this.model.getDocument().getAnnotationsFromOffset( this.getSelectionRange().to - 1 );
142142 // Filter out annotations that aren't textStyles or links
143143 for ( var i = 0; i < this.insertionAnnotations.length; i++ ) {
144144 if ( !this.insertionAnnotations[i].type.match( /(textStyle\/|link\/)/ ) ) {
@@ -280,7 +280,7 @@
281281
282282 ve.ce.Surface.prototype.pollContent = function() {
283283 var localOffset, text, hash;
284 -
 284+
285285 if ( this.poll.compositionStart !== null && this.poll.compositionEnd !== null ) {
286286
287287 text = ve.ce.Surface.getDOMText2( this.poll.node );
@@ -448,7 +448,7 @@
449449 break;
450450 }
451451 var range = this.getSelectionRange();
452 - if ( range.getLength() !== 0 ) {
 452+ if ( range.getLength() !== 0 && this.poll.compositionStart === null) {
453453 e.preventDefault();
454454 }
455455 };

Status & tagging log