Permalink
Browse files

Merge pull request #26 from timse/master

Changed the DOM-Ready to work in strict ECMA5
  • Loading branch information...
2 parents 7fec147 + 0279dcb commit 43d8b298ca6e4009f199bda199dd6b1495d1ab10 @eduardocereto eduardocereto committed Jul 9, 2012
Showing with 6 additions and 5 deletions.
  1. +6 −5 src/helpers.js
View
@@ -157,13 +157,14 @@ GasHelper.prototype._liveEvent = function(tag, evt, ofunc) {
*/
GasHelper.prototype._DOMReady = function(callback) {
var scp = this;
- var cb = function() {
- if (arguments.callee.done) return;
- arguments.callee.done = true;
- callback.apply(scp, arguments);
- };
if (/^(interactive|complete)/.test(document.readyState)) return cb();
this._addEventListener(document, 'DOMContentLoaded', cb, false);
this._addEventListener(window, 'load', cb, false);
+
+ function cb() {
+ if (cb.done) return;
+ cb.done = true;
+ callback.apply(scp, arguments);
+ }
};

0 comments on commit 43d8b29

Please sign in to comment.