r104912 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r104911‎ | r104912 | r104913 >
Date:23:00, 1 December 2011
Author:tparscal
Status:deferred
Tags:
Comment:
Made context icon not appear while dragging selection
Modified paths:
  • /trunk/extensions/VisualEditor/modules/es/views/es.SurfaceView.js (modified) (history)

Diff [purge]

Index: trunk/extensions/VisualEditor/modules/es/views/es.SurfaceView.js
@@ -129,7 +129,7 @@
130130 } );
131131 $window.scroll( function() {
132132 _this.dimensions.scrollTop = $window.scrollTop();
133 - if ( _this.currentSelection.from !== _this.currentSelection.to ) {
 133+ if ( _this.currentSelection.getLength() && !_this.mouse.selectingMode ) {
134134 _this.contextView.set();
135135 } else {
136136 _this.contextView.clear();
@@ -188,14 +188,17 @@
189189 es.SurfaceView.prototype.updateSelection = function( delay ) {
190190 var _this = this;
191191 function update() {
192 - if ( _this.currentSelection.from !== _this.currentSelection.to ) {
 192+ if ( _this.currentSelection.getLength() ) {
193193 _this.clearInsertionAnnotations();
194194 _this.hideCursor();
195195 _this.documentView.drawSelection( _this.currentSelection );
196 - _this.contextView.set();
197196 } else {
198197 _this.showCursor();
199198 _this.documentView.clearSelection( _this.currentSelection );
 199+ }
 200+ if ( _this.currentSelection.getLength() && !_this.mouse.selectingMode ) {
 201+ _this.contextView.set();
 202+ } else {
200203 _this.contextView.clear();
201204 }
202205 _this.updateSelectionTimeout = undefined;
@@ -335,6 +338,9 @@
336339 if ( e.button === 0 ) { // left mouse button
337340 this.mouse.selectingMode = this.mouse.selectedRange = null;
338341 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();
339345 }
340346 };
341347

Status & tagging log