public
Description: Various bits and helpers for Prototype and scriptaculous, that might prove useful or not. :)
Homepage:
Clone URL: git://github.com/madrobby/prototype_helpers.git
prototype_helpers / deferUntil / deferuntil.js
100644 7 lines (7 sloc) 0.194 kb
1
2
3
4
5
6
7
Function.prototype.deferUntil = function(condition){
  this.interval = setInterval(function(){
    if (!condition()) return;
    clearInterval(this.interval);
    this();
  }.bind(this), 50);
};