r100768 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r100767‎ | r100768 | r100769 >
Date:00:49, 26 October 2011
Author:inez
Status:deferred
Tags:
Comment:
New auto-scrolling - not finished
Modified paths:
  • /trunk/parsers/wikidom/lib/synth/views/es.SurfaceView.js (modified) (history)

Diff [purge]

Index: trunk/parsers/wikidom/lib/synth/views/es.SurfaceView.js
@@ -20,7 +20,8 @@
2121 clickDelay: 500,
2222 clickTimeout: null,
2323 clickPosition: null,
24 - hotSpotRadius: 1
 24+ hotSpotRadius: 1,
 25+ lastMovePosition: null
2526 };
2627 this.keyboard = {
2728 selecting: false,
@@ -96,14 +97,14 @@
9798
9899 this.dimensions = {
99100 width: this.$.width(),
100 - height: this.$.height(),
 101+ height: this.$window.height(),
101102 scrollTop: this.$window.scrollTop()
102103 };
103104
104105 // Re-render when resizing horizontally
105106 this.$window.resize( function() {
106107 surfaceView.hideCursor();
107 - surfaceView.dimensions.height = surfaceView.$.height();
 108+ surfaceView.dimensions.height = surfaceView.$window.height();
108109 var width = surfaceView.$.width();
109110 if ( surfaceView.dimensions.width !== width ) {
110111 surfaceView.dimensions.width = width;
@@ -200,32 +201,35 @@
201202 this.cursor.initialLeft = null;
202203 return false;
203204 };
204 -var lastEventPosition = new es.Position();
 205+
205206 es.SurfaceView.prototype.onMouseMove = function( e ) {
206207 if ( e.button === 0 /* left mouse button */ && this.mouse.selecting ) {
207 -
208 -
209 - if ( e.pageY - $(window).scrollTop() < 0 ) {
210 - lastEventPosition = es.Position.newFromEventPagePosition( e );
211 - stopScrolling();
212 - startScrolling(true);
213 - } else if ( e.pageY - $(window).scrollTop() <= window.innerHeight ) {
214 - stopScrolling();
 208+ if ( e.pageY - this.dimensions.scrollTop < 0 ) {
 209+ //this.mouse.lastMovePosition =
 210+ this.scroll( 'up' );
 211+ } else if( e.pageY - this.dimensions.scrollTop > this.dimensions.height ) {
 212+ this.scroll( 'down' );
215213 } else {
216 - lastEventPosition = es.Position.newFromEventPagePosition( e );
217 - stopScrolling();
218 - startScrolling();
 214+ this.scroll( 'stop' );
 215+ this.hideCursor();
 216+ this.selection.to = this.documentView.getOffsetFromEvent( e );
 217+ if ( !this.drawSelection() ) {
 218+ this.showCursor();
 219+ }
219220 }
220 -
221 - this.hideCursor();
222 - this.selection.to = this.documentView.getOffsetFromEvent( e );
223 - if ( !this.drawSelection() ) {
224 - this.showCursor();
225 - }
226 -
227221 }
228222 };
229223
 224+es.SurfaceView.prototype.scroll = function( type ) {
 225+/*
 226+ switch ( type ) {
 227+ case 'down':
 228+ this.mouse.lastMovePosition =
 229+ break;
 230+ };
 231+*/
 232+};
 233+
230234 es.SurfaceView.prototype.onMouseUp = function( e ) {
231235 if ( e.button === 0 /* left mouse button */ && this.selection.to ) {
232236 if ( this.drawSelection() ) {
@@ -377,6 +381,7 @@
378382
379383
380384
 385+
381386 var scrollStepDown = function() {
382387 lastEventPosition.top += 20;
383388 lastEventPosition.bottom += 20;

Status & tagging log