r92026 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r92025‎ | r92026 | r92027 >
Date:00:00, 13 July 2011
Author:tparscal
Status:deferred
Tags:
Comment:
Improved selection and cursor showing behavior.
Modified paths:
  • /trunk/parsers/wikidom/lib/es/es.Surface.js (modified) (history)

Diff [purge]

Index: trunk/parsers/wikidom/lib/es/es.Surface.js
@@ -94,7 +94,6 @@
9595 };
9696
9797 Surface.prototype.onKeyDown = function( e ) {
98 -
9998 switch ( e.keyCode ) {
10099 case 37: // Left arrow
101100 this.initialHorizontalCursorPosition = null;
@@ -177,19 +176,19 @@
178177 };
179178
180179 Surface.prototype.onMouseMove = function( e ) {
181 - this.cursor.hide();
182180 if ( e.button === 0 && this.selecting ) {
 181+ this.cursor.hide();
183182 this.selection.to = this.getLocationFromEvent( e );
184183 this.drawSelection();
185184 }
186185 };
187186
188187 Surface.prototype.onMouseUp = function( e ) {
189 - if ( e.button === 0 && this.selecting ) {
190 - this.selecting = false;
 188+ if ( e.button === 0 && this.selection.to ) {
191189 this.drawSelection();
192190 this.cursor.hide();
193191 }
 192+ this.selecting = false;
194193 };
195194
196195 /**

Status & tagging log