Permalink
Browse files

Added .clear() function.

  • Loading branch information...
1 parent e0295ce commit d92e3bba69320e50119fd849050d031c6807ac78 @jussi-kalliokoski committed Jun 1, 2011
Showing with 8 additions and 2 deletions.
  1. +8 −2 progress-bar.js
View
@@ -79,8 +79,7 @@ ProgressBar.prototype = {
graph +
this.symbols.rightBorder;
- this._output.cursorTo(0);
- this._output.clearLine(1);
+ this.clear();
var line = this.format.replace(this.interpreter, function(str, valueName, padding, pad){
padding = arguments[3] || 0;
@@ -107,6 +106,13 @@ ProgressBar.prototype = {
return val;
});
this._output.write(line);
+ },
+ /**
+ * Clears the progress bar off the screen.
+ */
+ clear: function(){
+ this._output.cursorTo(0);
+ this._output.clearLine(1);
}
}

0 comments on commit d92e3bb

Please sign in to comment.