r91583 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r91582‎ | r91583 | r91584 >
Date:19:10, 6 July 2011
Author:inez
Status:deferred
Tags:
Comment:
Basic support for cursor - displayed in correct place, but not blinking yet
Modified paths:
  • /trunk/parsers/wikidom/lib/es/es.Surface.js (modified) (history)

Diff [purge]

Index: trunk/parsers/wikidom/lib/es/es.Surface.js
@@ -18,12 +18,15 @@
1919 return surface.onMouseDown( e );
2020 }
2121 });
 22+
 23+ this.$cursor = $( '<div class="editSurface-cursor"></div>' );
 24+ this.$.after( this.$cursor );
2225 }
2326
2427 Surface.prototype.onMouseDown = function( e ) {
2528 var $target = $( e.target );
26 - $block = $target.is( '.editSurface-block' ) ? $target : $target.closest( '.editSurface-block' ),
27 - block = $block.data( 'block' );
 29+ $block = $target.is( '.editSurface-block' ) ? $target : $target.closest( '.editSurface-block' ),
 30+ block = $block.data( 'block' );
2831
2932 if( !block ) {
3033 return false;
@@ -42,7 +45,14 @@
4346 */
4447 Surface.prototype.setCursor = function( location ) {
4548 this.location = location;
46 - // ...
 49+
 50+ var position = this.location.block.getPosition( this.location.offset );
 51+ var offset = this.location.block.$.offset();
 52+
 53+ this.$cursor.css({
 54+ 'left': position.left + offset.left,
 55+ 'top': position.top + offset.top
 56+ }).show();
4757 };
4858
4959 /**

Status & tagging log