r92165 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r92164‎ | r92165 | r92166 >
Date:16:27, 14 July 2011
Author:hashar
Status:deferred
Tags:
Comment:
redraw selection after we have applied annotation

since r92102, block.renderContent use an offset as a first parameter
this patch use an undefined option and put the callback function as intended
as a second parameter.

Fix selection which was not uncorrect after applying 'bold'
Modified paths:
  • /trunk/parsers/wikidom/lib/es/es.Surface.js (modified) (history)

Diff [purge]

Index: trunk/parsers/wikidom/lib/es/es.Surface.js
@@ -529,6 +529,8 @@
530530 selection = this.selection;
531531 }
532532 var surface = this;
 533+ var undefOffset = undefined;
 534+
533535 if ( selection.from && selection.to ) {
534536 selection.normalize();
535537 var from = selection.start,
@@ -536,7 +538,7 @@
537539 if ( from.block === to.block ) {
538540 // Single block annotation
539541 from.block.annotateContent( annotation, from.offset, to.offset );
540 - from.block.renderContent( function() {
 542+ from.block.renderContent( undefOffset, function() {
541543 surface.drawSelection();
542544 } );
543545 } else {
@@ -546,19 +548,19 @@
547549 if ( block === from.block ) {
548550 // From offset to length
549551 block.annotateContent( annotation, from.offset, block.getLength() );
550 - block.renderContent( function() {
 552+ block.renderContent( undefOffset, function() {
551553 surface.drawSelection();
552554 } );
553555 } else if ( block === to.block ) {
554556 // From 0 to offset
555557 block.annotateContent( annotation, 0, to.offset );
556 - block.renderContent( function() {
 558+ block.renderContent( undefOffset, function() {
557559 surface.drawSelection();
558560 } );
559561 } else {
560562 // Full coverage
561563 block.annotateContent( annotation, 0, block.getLength() );
562 - block.renderContent( function() {
 564+ block.renderContent( undefOffset, function() {
563565 surface.drawSelection();
564566 } );
565567 }

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r92102Made flowing iterative, only doing 3 lines at a time, allowing input to be ta...tparscal22:01, 13 July 2011

Status & tagging log