r93329 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r93328‎ | r93329 | r93330 >
Date:22:49, 27 July 2011
Author:tparscal
Status:deferred
Tags:
Comment:
Improved performance of appendLine
Modified paths:
  • /trunk/parsers/wikidom/lib/es/es.TextFlow.js (modified) (history)

Diff [purge]

Index: trunk/parsers/wikidom/lib/es/es.TextFlow.js
@@ -378,10 +378,10 @@
379379 es.TextFlow.prototype.appendLine = function( range, wordOffset, fractional ) {
380380 var rs = this.renderState,
381381 lineCount = rs.lines.length;
382 - $line = this.$.find( '.editSurface-line[line-index=' + lineCount + ']' );
 382+ $line = this.$.children( '[line-index=' + lineCount + ']' );
383383 if ( !$line.length ) {
384 - $line = $( '<div class="editSurface-line" line-index="' + lineCount + '"></div>' )
385 - .appendTo( this.$ );
 384+ $line = $( '<div class="editSurface-line" line-index="' + lineCount + '"></div>' );
 385+ this.$.append( $line );
386386 }
387387 $line[0].innerHTML = this.content.render( range );
388388 // Collect line information

Status & tagging log