Skip to content

Instantly share code, notes, and snippets.

@frewsxcv
Created September 13, 2012 20:36
Show Gist options
  • Save frewsxcv/3717440 to your computer and use it in GitHub Desktop.
Save frewsxcv/3717440 to your computer and use it in GitHub Desktop.
status
Status = (function() {
function Status() {
this.$status = $('#status');
}
Status.prototype.set = function(str) {
var _this = this;
this.$status.text(str);
if (this.timeoutID) {
console.log('cleared: ' + this.timeoutID);
window.clearTimeout(this.timeoutId);
}
this.timeoutID = window.setTimeout((function() {
return _this.clear();
}), 3000);
return console.log('set: ' + this.timeoutID);
};
Status.prototype.clear = function() {
return this.$status.text('');
};
return Status;
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment