lib/watir/dom/extensions/js/waitForDom.js in watir-dom-wait-0.1.2 vs lib/watir/dom/extensions/js/waitForDom.js in watir-dom-wait-0.1.3

- old
+ new

@@ -54,23 +54,25 @@ function Watir(options) { this.set(options); this.startedModifying = false; - this.domReady = 1; + this.domReady = 1; this.bindDOMEvents(); this.exitOnTimeout(); }; Watir.prototype.set = function (options) { - if (options == null) options = {}; + if (options == null) { + options = {}; + } - this.el = options.el; - this.event = options.event || 'DOMSubtreeModified'; + this.el = options.el; + this.event = options.event || 'DOMSubtreeModified'; this.interval = options.interval; - this.delay = options.delay; + this.delay = options.delay; this.forceReady = this.wrappedForceReady(); this.startModifying = this.wrappedStartModifying(); } @@ -118,11 +120,10 @@ Watir.prototype.addEventListener = (function() { if (window.addEventListener) { return function (fn) { this.el.addEventListener(this.event, fn, false); }; - } else { return function (fn) { this.el.attachEvent('on' + this.event, fn) }; } @@ -131,18 +132,18 @@ Watir.prototype.removeEventListener = (function() { if (window.removeEventListener) { return function (fn) { this.el.removeEventListener(this.event, fn, false); }; - } else { return function (fn) { this.el.detachEvent('on' + this.event, fn) }; } })(); window.watir = new Watir({ - el: arguments[0], + el: arguments[0], interval: arguments[1] * 1000, - delay: arguments[2] * 1000, + delay: arguments[2] * 1000, }); +