Index: trunk/extensions/VisualEditor/modules/es/views/es.SurfaceView.js |
— | — | @@ -129,7 +129,7 @@ |
130 | 130 | } ); |
131 | 131 | $window.scroll( function() { |
132 | 132 | _this.dimensions.scrollTop = $window.scrollTop(); |
133 | | - if ( _this.currentSelection.from !== _this.currentSelection.to ) { |
| 133 | + if ( _this.currentSelection.getLength() && !_this.mouse.selectingMode ) { |
134 | 134 | _this.contextView.set(); |
135 | 135 | } else { |
136 | 136 | _this.contextView.clear(); |
— | — | @@ -188,14 +188,17 @@ |
189 | 189 | es.SurfaceView.prototype.updateSelection = function( delay ) { |
190 | 190 | var _this = this; |
191 | 191 | function update() { |
192 | | - if ( _this.currentSelection.from !== _this.currentSelection.to ) { |
| 192 | + if ( _this.currentSelection.getLength() ) { |
193 | 193 | _this.clearInsertionAnnotations(); |
194 | 194 | _this.hideCursor(); |
195 | 195 | _this.documentView.drawSelection( _this.currentSelection ); |
196 | | - _this.contextView.set(); |
197 | 196 | } else { |
198 | 197 | _this.showCursor(); |
199 | 198 | _this.documentView.clearSelection( _this.currentSelection ); |
| 199 | + } |
| 200 | + if ( _this.currentSelection.getLength() && !_this.mouse.selectingMode ) { |
| 201 | + _this.contextView.set(); |
| 202 | + } else { |
200 | 203 | _this.contextView.clear(); |
201 | 204 | } |
202 | 205 | _this.updateSelectionTimeout = undefined; |
— | — | @@ -335,6 +338,9 @@ |
336 | 339 | if ( e.button === 0 ) { // left mouse button |
337 | 340 | this.mouse.selectingMode = this.mouse.selectedRange = null; |
338 | 341 | this.model.select( this.currentSelection ); |
| 342 | + // We have to manually call this because the selection will not have changed between the |
| 343 | + // most recent mousemove and this mouseup |
| 344 | + this.contextView.set(); |
339 | 345 | } |
340 | 346 | }; |
341 | 347 | |