r92170 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r92169‎ | r92170 | r92171 >
Date:17:40, 14 July 2011
Author:tparscal
Status:ok
Tags:
Comment:
Passing actual offsets to render functions.
Modified paths:
  • /trunk/parsers/wikidom/lib/es/es.Surface.js (modified) (history)

Diff [purge]

Index: trunk/parsers/wikidom/lib/es/es.Surface.js
@@ -529,8 +529,6 @@
530530 selection = this.selection;
531531 }
532532 var surface = this;
533 - var undefOffset = undefined;
534 -
535533 if ( selection.from && selection.to ) {
536534 selection.normalize();
537535 var from = selection.start,
@@ -538,7 +536,7 @@
539537 if ( from.block === to.block ) {
540538 // Single block annotation
541539 from.block.annotateContent( annotation, from.offset, to.offset );
542 - from.block.renderContent( undefOffset, function() {
 540+ from.block.renderContent( from.offset, function() {
543541 surface.drawSelection();
544542 } );
545543 } else {
@@ -548,19 +546,19 @@
549547 if ( block === from.block ) {
550548 // From offset to length
551549 block.annotateContent( annotation, from.offset, block.getLength() );
552 - block.renderContent( undefOffset, function() {
 550+ block.renderContent( from.offset, function() {
553551 surface.drawSelection();
554552 } );
555553 } else if ( block === to.block ) {
556554 // From 0 to offset
557555 block.annotateContent( annotation, 0, to.offset );
558 - block.renderContent( undefOffset, function() {
 556+ block.renderContent( 0, function() {
559557 surface.drawSelection();
560558 } );
561559 } else {
562560 // Full coverage
563561 block.annotateContent( annotation, 0, block.getLength() );
564 - block.renderContent( undefOffset, function() {
 562+ block.renderContent( 0, function() {
565563 surface.drawSelection();
566564 } );
567565 }

Status & tagging log