Index: trunk/parsers/wikidom/lib/hype/bases/es.DocumentNode.js |
— | — | @@ -146,12 +146,14 @@ |
147 | 147 | } |
148 | 148 | if ( start == left - 1 ) { |
149 | 149 | // start is between this[i-1] and this[i], move it to left for convenience |
150 | | - // We don't need to check for start < end here because we already have start != end and start <= end |
| 150 | + // We don't need to check for start < end here because we already have start != end and |
| 151 | + // start <= end |
151 | 152 | start = left; |
152 | 153 | } |
153 | 154 | if ( end == right + 1 ) { |
154 | 155 | // end is between this[i] and this[i+1], move it to right for convenience |
155 | | - // We don't need to check for start < end here because we already have start != end and start <= end |
| 156 | + // We don't need to check for start < end here because we already have start != end and |
| 157 | + // start <= end |
156 | 158 | end = right; |
157 | 159 | } |
158 | 160 | |
— | — | @@ -166,7 +168,8 @@ |
167 | 169 | // Recurse into this[i] |
168 | 170 | nodes = this[i].selectNodes( new es.Range( start - left, end - left ) ); |
169 | 171 | } |
170 | | - // Since the start and end are both inside this[i], we know for sure that we're done, so return |
| 172 | + // Since the start and end are both inside this[i], we know for sure that we're done, so |
| 173 | + // return |
171 | 174 | return nodes; |
172 | 175 | } else if ( startInside ) { |
173 | 176 | // The start is inside this[i] but the end isn't |
Index: trunk/parsers/wikidom/lib/hype/views/es.ContentView.js |
— | — | @@ -350,15 +350,15 @@ |
351 | 351 | */ |
352 | 352 | var $ruler = $( '<div class="editSurface-ruler"></div>' ).appendTo( this.$ ), |
353 | 353 | ruler = $ruler[0], |
354 | | - fit = this.fitCharacters( line.range, ruler, position.left ); |
| 354 | + fit = this.fitCharacters( line.range, ruler, position.left ), |
| 355 | + center; |
355 | 356 | ruler.innerHTML = this.getHtml( new es.Range( line.range.start, fit.end ) ); |
356 | 357 | if ( fit.end < this.model.getContentLength() ) { |
357 | 358 | var left = ruler.clientWidth; |
358 | 359 | ruler.innerHTML = this.getHtml( new es.Range( line.range.start, fit.end + 1 ) ); |
359 | | - var right = ruler.clientWidth; |
360 | | - var center = Math.round( left + ( ( right - left ) / 2 ) ); |
| 360 | + center = Math.round( left + ( ( ruler.clientWidth - left ) / 2 ) ); |
361 | 361 | } else { |
362 | | - var center = ruler.clientWidth; |
| 362 | + center = ruler.clientWidth; |
363 | 363 | } |
364 | 364 | $ruler.remove(); |
365 | 365 | // Reset RegExp object's state |