r100673 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r100672‎ | r100673 | r100674 >
Date:01:18, 25 October 2011
Author:inez
Status:deferred
Tags:
Comment:
Proof of concept code (to be refactore) for auto-scrolling when selecting with mouse and it is below the window
Modified paths:
  • /trunk/parsers/wikidom/lib/synth/views/es.DocumentView.js (modified) (history)
  • /trunk/parsers/wikidom/lib/synth/views/es.SurfaceView.js (modified) (history)

Diff [purge]

Index: trunk/parsers/wikidom/lib/synth/views/es.SurfaceView.js
@@ -213,6 +213,7 @@
214214 }
215215 }
216216 this.mouse.selecting = false;
 217+ stopScrolling();
217218 };
218219
219220 es.SurfaceView.prototype.onCut = function( e ) {
Index: trunk/parsers/wikidom/lib/synth/views/es.DocumentView.js
@@ -62,7 +62,7 @@
6363 ? $target : $target.closest( '.editSurface-block' ),
6464 position = es.Position.newFromEventPagePosition( e );
6565
66 - if( $block.length ) {
 66+ if( false && $block.length ) {
6767 var block = $block.data( 'block' ),
6868 offset = block.getOffsetFromPosition( position );
6969 while ( typeof block.list !== 'undefined' ) {
@@ -71,6 +71,15 @@
7272 }
7373 return offset;
7474 } else {
 75+ //console.log(position.top);
 76+
 77+ if (position.top - $(window).scrollTop() > window.innerHeight) {
 78+ console.log("b " + position.top);
 79+ position.top = window.innerHeight + $(window).scrollTop() + 10;
 80+ console.log("j " + position.top);
 81+ }
 82+
 83+
7584 return this.getOffsetFromPosition( position );
7685 }
7786 };
@@ -86,7 +95,15 @@
8796 if ( this.items.length === 0 ) {
8897 return 0;
8998 }
 99+
 100+ if (position.top - $(window).scrollTop() > window.innerHeight) {
 101+ console.log("b " + position.top);
 102+ position.top = window.innerHeight + $(window).scrollTop() + 10;
 103+ position.left = window.innerWidth;
 104+ console.log("j " + position.top);
 105+ }
90106
 107+
91108 var blockView = this.items[0];
92109
93110 for ( var i = 1; i < this.items.length; i++ ) {

Status & tagging log