r92221 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r92220‎ | r92221 | r92222 >
Date:00:09, 15 July 2011
Author:tparscal
Status:deferred
Tags:
Comment:
Update cursor on resize.
Modified paths:
  • /trunk/parsers/wikidom/lib/es/es.Surface.js (modified) (history)

Diff [purge]

Index: trunk/parsers/wikidom/lib/es/es.Surface.js
@@ -15,14 +15,14 @@
1616 this.keyboardSelecting = false;
1717 this.keydownTimeout = null;
1818 this.initialHorizontalCursorPosition = null;
19 -
 19+
2020 // MouseDown on surface
2121 this.$.bind({
2222 'mousedown' : function(e) {
2323 return surface.onMouseDown( e );
2424 }
2525 });
26 -
 26+
2727 // Selection
2828 this.$ranges = $( '<div class="editSurface-ranges"></div>' ).prependTo( this.$ );
2929 this.$rangeStart = $( '<div class="editSurface-range"></div>' ).appendTo( this.$ranges );
@@ -61,12 +61,16 @@
6262 });
6363
6464 $(window).resize( function() {
 65+ surface.cursor.hide();
6566 surface.doc.updateBlocks();
6667 } );
6768
6869 this.doc.on( 'update', function() {
6970 surface.drawSelection();
70 - // TODO: Update the cursor position
 71+ if ( surface.location && surface.location.block ) {
 72+ var cursorPosition = surface.location.block.getPosition( surface.location.offset );
 73+ surface.cursor.show( cursorPosition, surface.location.block.$.offset() );
 74+ }
7175 } );
7276
7377 // First render

Status & tagging log