Skip to content

Instantly share code, notes, and snippets.

@divoxx
Created March 4, 2009 20:15
Show Gist options
  • Save divoxx/73976 to your computer and use it in GitHub Desktop.
Save divoxx/73976 to your computer and use it in GitHub Desktop.
var reapplyTimeoutId = null
$each(['insertBefore', 'replaceChild', 'removeChild', 'appendChild'], function(methodName) {
Node.prototype["_" + methodName] = Node.prototype[methodName]
Node.prototype[methodName] = function() {
var ret = this["_" + methodName](arguments[0], arguments[1])
if (reapplyTimeoutId) { clearTimeout(reapplyTimeoutId) }
reapplyTimeoutId = setTimeout(Attitude.applyDefinitions.bind(Attitude), 100)
return ret
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment