r91702 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r91701‎ | r91702 | r91703 >
Date:00:25, 8 July 2011
Author:tparscal
Status:deferred
Tags:
Comment:
Prevent calling rendering while rendering is already taking place, and automatically re-render if something changed while rendering was taking place.
Modified paths:
  • /trunk/parsers/wikidom/lib/es/es.TextFlow.js (modified) (history)

Diff [purge]

Index: trunk/parsers/wikidom/lib/es/es.TextFlow.js
@@ -234,8 +234,9 @@
235235 * text, but will be automatically ignored if the text or width of the container has changed.
236236 *
237237 * @param offset {Integer} Offset to re-render from, if possible (not yet implemented)
 238+ * @param callback {Function} Function to execute when flowing is complete
238239 */
239 -TextFlow.prototype.render = function( offset ) {
 240+TextFlow.prototype.render = function( offset, callback ) {
240241 // Reset lines in the DOM and the "lines" array
241242 this.$.empty();
242243
@@ -300,6 +301,10 @@
301302 }
302303 // Cleanup
303304 $ruler.remove();
 305+
 306+ if ( $.isFunction( callback ) ) {
 307+ callback();
 308+ }
304309 };
305310
306311 /**

Status & tagging log