r91318 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r91317‎ | r91318 | r91319 >
Date:22:55, 1 July 2011
Author:inez
Status:deferred
Tags:
Comment:
Attempt to insertContent on mousedown
Modified paths:
  • /trunk/parsers/wikidom/lib/es/es.Surface.js (modified) (history)

Diff [purge]

Index: trunk/parsers/wikidom/lib/es/es.Surface.js
@@ -11,11 +11,13 @@
1212 this.render();
1313
1414 this.$.mousedown(function(e) {
15 - // what block is that? (from $(e.target).closest('.editSurface-block'))
16 - // what offset is that?
17 - // block.getOffset(
18 - // new Position(e.pageX - $e.target).offset().left, e.pageY - $e.target).offset().top)
19 - // )
 15+ var $target = $( e.target );
 16+ $block = $target.is( '.editSurface-block' ) ? $target : $target.closest( '.editSurface-block' ),
 17+ block = $block.data( 'block' );
 18+ var position = new Position(e.pageX - $(e.target).offset().left, $(e.target).offset().top);
 19+ var offest = block.flow.getOffset( position );
 20+ block.insertContent(offest, '___!___');
 21+
2022 // setCursor(new Location(block, offset))
2123 });
2224 }

Status & tagging log