r93326 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r93325‎ | r93326 | r93327 >
Date:22:40, 27 July 2011
Author:tparscal
Status:deferred
Tags:
Comment:
Added contains offset to es.Range
Modified paths:
  • /trunk/parsers/wikidom/lib/es/es.Range.js (modified) (history)
  • /trunk/parsers/wikidom/lib/es/es.TextFlow.js (modified) (history)

Diff [purge]

Index: trunk/parsers/wikidom/lib/es/es.TextFlow.js
@@ -147,7 +147,7 @@
148148 };
149149 while ( position.line < lineCount ) {
150150 line = this.lines[position.line];
151 - if ( offset >= line.range.start && offset < line.range.end ) {
 151+ if ( line.range.containsOffset( offset ) ) {
152152 position.bottom = position.top + line.height;
153153 break;
154154 }
Index: trunk/parsers/wikidom/lib/es/es.Range.js
@@ -15,6 +15,11 @@
1616 this.normalize();
1717 };
1818
 19+es.Range.prototype.containsOffset = function( offset ) {
 20+ this.normalize();
 21+ return offset >= this.start && offset < this.end;
 22+};
 23+
1924 es.Range.prototype.getLength = function() {
2025 return Math.abs( this.from - this.to );
2126 };

Status & tagging log